set user-defined limits and apply them
771737
def set_xylims(self, limits, axes=None, side='left'):
        ""
        if axes is None:
            axes = self.axes
            if side == 'right':
                axes = self.get_right_axes()
        self.conf.user_limits[axes] = limits
        self.unzoom_all()
115559
synchronized void setLimits(int txnsPerSec, int maxOutstanding) {
        m_autoTune = false;
        /*
         * If the rate limit is some reasonably low value then go through the effort
         * of rate limiting
         */
        if (txnsPerSec < Integer.MAX_VALUE / 2) {
            m_doesAnyTuning = true;
        }
        m_targetTxnsPerSecond = txnsPerSec;
        m_maxOutstandingTxns = maxOutstanding;
        m_outstandingTxnsSemaphore.drainPermits();
        m_outstandingTxnsSemaphore.release(maxOutstanding);
    }
1150827
def set_scale_limits(self, scale_min, scale_max):
        
        # TODO: force scale to within limits if already outside?
        self.t_.set(scale_min=scale_min, scale_max=scale_max)
105306
protected function offsetLimit()
    {
        if ($this->limit != 0 || $this->offset != 0)
            $this->documents = array_slice($this->documents, $this->offset, $this->limit);
    }
668003
def limit=(limit)

      if !limit.nil? && limit > 200
        fail ArgumentError, "invalid value for 'limit', must be smaller than or equal to 200."
      end

      if !limit.nil? && limit < 1
        fail ArgumentError, "invalid value for 'limit', must be greater than or equal to 1."
      end

      @limit = limit
    end
1315
def set_buffer_limits(self, high=None, low=None):
        """"""
        if high is None:
            high = self.default_buffer_size
        if low is None:
            low = high // 2
        self._buffer_high = high
        self._buffer_low = low
113119
def apply_reactions(self, user):
        
        # User attributes
        if self.global_limit:
            self._log.info('Enforcing Global Trigger Limit of {num} seconds'.format(num=self.global_limit))
            self.agentml.set_limit(self, (time() + self.global_limit), self.glimit_blocking)

        if self.user_limit:
            self._log.info('Enforcing User Trigger Limit of {num} seconds'.format(num=self.user_limit))
            user.set_limit(self, (time() + self.user_limit), self.ulimit_blocking)

        for var in self.vars:
            var_type, var_name, var_value = var
            var_name  = ''.join(map(str, var_name)) if isinstance(var_name, Iterable) else var_name
            var_value = ''.join(map(str, var_value)) if isinstance(var_value, Iterable) else var_value

            # Set a user variable
            if var_type == 'user':
                self.user.set_var(var_name, var_value)

            # Set a global variable
            if var_type == 'global':
                self.agentml.set_var(var_name, var_value)
608168
def load_limits(self, config):
        """"""
        # By default set the history length to 3 points per second during one day
        self._limits['history_size'] = 28800

        if not hasattr(config, 'has_section'):
            return False

        # Read the global section
        if config.has_section('global'):
            self._limits['history_size'] = config.get_float_value('global', 'history_size', default=28800)
            logger.debug("Load configuration key: {} = {}".format('history_size', self._limits['history_size']))

        # Read the plugin specific section
        if config.has_section(self.plugin_name):
            for level, _ in config.items(self.plugin_name):
                # Read limits
                limit = '_'.join([self.plugin_name, level])
                try:
                    self._limits[limit] = config.get_float_value(self.plugin_name, level)
                except ValueError:
                    self._limits[limit] = config.get_value(self.plugin_name, level).split(",")
                logger.debug("Load limit: {} = {}".format(limit, self._limits[limit]))

        return True
1323296
public function limit( $new_limit ) {
		$this->limit = $new_limit;
		if ( false === starts_with( $new_limit . '', ':' ) ) {
			$this->limit = (int) $new_limit;
		}
	}
1091747
public R setLimit(int limit) {
        mQueryMap.put(LIMIT, String.valueOf(limit));
        return (R) this;
    }
488111
def limit(self, limit):
    
    params = join_params(self.parameters, {"limit": limit})

    return self.__class__(**params)
685305
def _limit_value(value, upper=1.0, lower=0.0):
    
    if value > upper:
        return(upper)
    if value < lower:
        return(lower)
    return value
307861
def set_current_limit(self, value, channel=1):
        
        cmd = "I%d %f" % (channel, value)
        self.write(cmd)
305838
def set_slimits(self, min, max):
        
        self.limits['smin'] = sqrt(min)
        self.limits['smax'] = sqrt(max)
581900
function normalizeLimit (options) {
  const limit = options.limit || options.resultRecordCount || options.count || options.maxFeatures
  // If there is a limit, add 1 to it so we can later calculate a limitExceeded. The result set will be resized accordingly, post SQL
  if (limit) return limit + 1
}
324504
def apply_rate_limit?(env)
      @exceptions.none? { |e| e.call(env) } && @conditions.all? { |c| c.call(env) }
    end
1190815
function limit($limit)
    {
        if (!empty($limit))
        {
            $_limit = explode(',', $limit, 2);
            if (count($_limit) == 2)
            {
                $this->limit = 'limit ' . (int)$_limit[0] . ',' . (int)$_limit[1];
            }
            else
            {
                $this->limit = "limit " . (int)$limit;
            }
        }
        else
        {
            $this->limit = '';
        }
    }