Returns the number of unit to skip to be able to display up to `capacity` number of ticks
in `unit` for the given `min` / `max` range and respecting the interval steps constraints.
342339
function determineStepSize(min, max, unit, capacity) {
	var range = max - min;
	var interval = INTERVALS[unit];
	var milliseconds = interval.size;
	var steps = interval.steps;
	var i, ilen, factor;

	if (!steps) {
		return Math.ceil(range / (capacity * milliseconds));
	}

	for (i = 0, ilen = steps.length; i < ilen; ++i) {
		factor = steps[i];
		if (Math.ceil(range / (milliseconds * factor)) <= capacity) {
			break;
		}
	}

	return factor;
}
660251
def min(self):
        

        if len(self.regions) != 1:
            raise ClaripyVSAOperationError("'min()' onlly works on single-region value-sets.")

        return self.get_si(next(iter(self.regions))).min
1143549
def min(self):
        
        return int(self._min) if not np.isinf(self._min) else self._min
579423
def minimum_needs_unit(field, feature, parent):
    
    _ = feature, parent  # NOQA
    field_definition = definition(field, 'field_name')
    if field_definition:
        unit_abbreviation = None
        frequency = None
        if field_definition.get('need_parameter'):
            need = field_definition['need_parameter']
            if isinstance(need, ResourceParameter):
                unit_abbreviation = need.unit.abbreviation
                frequency = need.frequency
        elif field_definition.get('unit'):
            need_unit = field_definition.get('unit')
            unit_abbreviation = need_unit.get('abbreviation')

        if field_definition.get('frequency') and not frequency:
            frequency = field_definition.get('frequency')

        if not unit_abbreviation:
            unit_abbreviation = exposure_unit['plural_name']

        once_frequency_field_keys = [
            'minimum_needs__toilets_count_field'
        ]
        if not frequency or (
                field_definition['key'] in once_frequency_field_keys):
            return unit_abbreviation.lower()

        unit_format = '{unit_abbreviation}/{frequency}'
        return unit_format.format(
            unit_abbreviation=unit_abbreviation, frequency=frequency).lower()

    return None
524854
function() {
			var me = this;
			var labels = me.getLabels();
			me.minIndex = 0;
			me.maxIndex = labels.length - 1;
			var findIndex;

			if (me.options.ticks.min !== undefined) {
				// user specified min value
				findIndex = helpers.indexOf(labels, me.options.ticks.min);
				me.minIndex = findIndex !== -1 ? findIndex : me.minIndex;
			}

			if (me.options.ticks.max !== undefined) {
				// user specified max value
				findIndex = helpers.indexOf(labels, me.options.ticks.max);
				me.maxIndex = findIndex !== -1 ? findIndex : me.maxIndex;
			}

			me.min = labels[me.minIndex];
			me.max = labels[me.maxIndex];
		}
105015
def unit_id(self, unit_id=None):
        
        if unit_id is None:
            return self.__unit_id
        if 0 <= int(unit_id) < 256:
            self.__unit_id = int(unit_id)
            return self.__unit_id
        else:
            return None
187286
def min_interval(self,name, alpha=_alpha, **kwargs):
        
        data = self.get(name, **kwargs)
        return min_interval(data,alpha)
1032182
function range(defaultMin, defaultMax, min, max) {
  if (min === undefined) {
    return integer(defaultMin, defaultMax); // ()
  }

  if (max === undefined) {
    return min; // ( len )
  }

  return integer(min, max); // ( min, max )
}
868370
public float getCount(TimeUnit unit) {
    int ord = unit.ordinal;
    if (counts[ord] == 0) {
      return 0;
    }
    return (counts[ord] - 1)/1000f;
  }
1051187
function (tickInterval, min, max) {
		var pos,
			lastPos,
			roundedMin = correctFloat(mathFloor(min / tickInterval) * tickInterval),
			roundedMax = correctFloat(mathCeil(max / tickInterval) * tickInterval),
			tickPositions = [];

		// Populate the intermediate values
		pos = roundedMin;
		while (pos <= roundedMax) {

			// Place the tick on the rounded value
			tickPositions.push(pos);

			// Always add the raw tickInterval, not the corrected one.
			pos = correctFloat(pos + tickInterval);

			// If the interval is not big enough in the current min - max range to actually increase
			// the loop variable, we need to break out to prevent endless loop. Issue #619
			if (pos === lastPos) {
				break;
			}

			// Record the last value
			lastPos = pos;
		}
		return tickPositions;
	}
408005
def length_range(string, minimum, maximum):
    
    int_range(len(string), minimum, maximum)
    return string
1252080
def range_minmax(ranges):
    
    rmin = min(ranges)[0]
    rmax = max(ranges, key=lambda x: x[1])[1]
    return rmin, rmax
216141
def min(self):
        
        res = self._qexec("min(%s)" % self._name)
        if len(res) > 0:
            self._min = res[0][0]
        return self._min
790897
def get_min(self,*args,**kwargs):
        
        if len(args) == 1:
            return self.spike_times.get_label(args[0]).min
        return [self.spike_times.get_label(a).max for a in args]
887823
def range_for_length(self, length):
        
        if self.units != "bytes" or length is None or len(self.ranges) != 1:
            return None
        start, end = self.ranges[0]
        if end is None:
            end = length
            if start < 0:
                start += length
        if is_byte_range_valid(start, end, length):
            return start, min(end, length)
762666
def intervals(_min, _max=None, size=1):
    
    if _max == None:
        _max = _min
        _min = 0
    _max = int(mo_math.ceiling(_max))
    _min = int(mo_math.floor(_min))

    output = ((x, min(x + size, _max)) for x in _range(_min, _max, size))
    return output
1303511
def get_min_max_mag(self):
        ""
        mag, num_bins = self._get_min_mag_and_num_bins()
        return mag, mag + self. bin_width * (num_bins - 1)