Returns a discrete range.
480222
def drange(v0, v1, d):
    """"""
    assert v0 < v1
    return xrange(int(v0)//d, int(v1+d)//d)
441280
def _digits(minval, maxval):
    """"""
    if minval == maxval:
        return 3
    else:
        return min(10, max(2, int(1 + abs(np.log10(maxval - minval)))))
451241
function createRange(fromRight) {
  return function(start, end, step) {
    if (step && typeof step != 'number' && _isIterateeCall(start, end, step)) {
      end = step = undefined;
    }
    // Ensure the sign of `-0` is preserved.
    start = toFinite_1(start);
    if (end === undefined) {
      end = start;
      start = 0;
    } else {
      end = toFinite_1(end);
    }
    step = step === undefined ? (start < end ? 1 : -1) : toFinite_1(step);
    return _baseRange(start, end, step, fromRight);
  };
}
644038
function rangesIntersect(rangeA, rangeB) {
  return rangeA.compareBoundaryPoints(Range.END_TO_START, rangeB) === -1 &&
    rangeA.compareBoundaryPoints(Range.START_TO_END, rangeB) === 1
}
1004658
def canonicalize(interval, lower_inc=True, upper_inc=False):
    
    if not interval.discrete:
        raise TypeError('Only discrete ranges can be canonicalized')

    if interval.empty:
        return interval

    lower, lower_inc = canonicalize_lower(interval, lower_inc)
    upper, upper_inc = canonicalize_upper(interval, upper_inc)

    return interval.__class__(
        [lower, upper],
        lower_inc=lower_inc,
        upper_inc=upper_inc,
    )
1297417
def get_range(self, start=None, stop=None):
		
		return self.from_iterable(self.ranges(start, stop))
515297
public static int discretize(double value, double min, double max, int binCount) {
        int discreteValue = (int) (binCount * normalize(value, min, max));
        return clamp(discreteValue, 0, binCount - 1);
    }
733039
def sample_discrete_from_log(p_log,axis=0,dtype=np.int32):
    ''
    cumvals = np.exp(p_log - np.expand_dims(p_log.max(axis),axis)).cumsum(axis) # cumlogaddexp
    thesize = np.array(p_log.shape)
    thesize[axis] = 1
    randvals = random(size=thesize) * \
            np.reshape(cumvals[[slice(None) if i is not axis else -1
                for i in range(p_log.ndim)]],thesize)
    return np.sum(randvals > cumvals,axis=axis,dtype=dtype)
473033
def range(self, start='-', stop='+', count=None):
        
        return self.database.xrange(self.key, start, stop, count)
565908
public static int[] range(int start, int end) {
    int[] out = new int[end - start];
    for(int i = 0, j = start; j < end; i++, j++) {
      out[i] = j;
    }
    return out;
  }
288879
function iterRanges(min, max, padding) {
  let index = min;

  return {
    reset: () => { index = min; },
    next: () => {
      if (index <= max) {
        let value = index;
        if (padding) {
          value = padNumber(index, padding);
        }
        index += 1;

        return {
          value,
          done: false,
        };
      }
      return { done: true };
    },
  };
}
1170613
def range(self, value):
        """"""
        self._buffer.append(abs(value))
        mean = sum(self._buffer) / len(self._buffer)
        estimate = next(
            (r for r in self.ranges if mean < self.scale * r),
            self.ranges[-1]
        )
        if self._mapping:
            return self._mapping[estimate]
        else:
            return estimate
362001
public static Range absRange(Range range) {
        if (range.getMinimum().doubleValue() >= 0 && range.getMaximum().doubleValue() >= 0) {
            return range;
        } else if (range.getMinimum().doubleValue() < 0 && range.getMaximum().doubleValue() < 0) {
            return range(- range.getMaximum().doubleValue(), - range.getMinimum().doubleValue());
        } else {
            return range(0, Math.max(range.getMinimum().doubleValue(), range.getMaximum().doubleValue()));
        }
    }
857843
def range(self, axis=None):
        
        return (self.min(axis=axis), self.max(axis=axis))
1066347
def selection_range(self):
        
        selected = self.selectionModel().selection()
        """:type: QItemSelection """

        if selected.isEmpty():
            return -1, -1, -1, -1

        min_row = numpy.min([rng.top() for rng in selected])
        max_row = numpy.max([rng.bottom() for rng in selected])
        start = numpy.min([rng.left() for rng in selected])
        end = numpy.max([rng.right() for rng in selected]) + 1

        return min_row, max_row, start, end
85139
public static int[] range(int start, int stop, int step) {
		if (start < stop) {
			step = Math.abs(step);
		} else if (start > stop) {
			step = -Math.abs(step);
		} else {// start == end
			return new int[] { start };
		}

		int size = Math.abs((stop - start) / step) + 1;
		int[] values = new int[size];
		int index = 0;
		for (int i = start; (step > 0) ? i <= stop : i >= stop; i += step) {
			values[index] = i;
			index++;
		}
		return values;
	}
733116
function range(begin, end, interval = 1) {
  var a = [];

  for (let i = begin; i < (begin+end); i += interval) {
    a.push(i);
  }

  return a;
}