Calculates the range depending on the config settings.
434333
def calculateRange(self):
        
        if not self.autoRangeCti or not self.autoRangeCti.configValue:
            return (self.rangeMinCti.data, self.rangeMaxCti.data)
        else:
            rangeFunction = self._rangeFunctions[self.autoRangeMethod]
            return rangeFunction()
1337863
function rangeFromIndexAndOffsets(i, before, after, length) {
  return {
    // Guard against the negative upper bound for lines included in the output.
    from: i - before > 0 ? i - before : 0,
    to: i + after > length ? length : i + after
  };
}
318450
def _range_check(self, value, min_value, max_value):
        '''
        
        '''
        if value < min_value or value > max_value:
            raise ValueError('%s out of range - %s is not between %s and %s' % (self.__class__.__name__, value, min_value, max_value))
104448
public static Long calculateRangeLength(FileRequestContext context, Range range) {
    if(range.start == -1) range.start = 0;
    if(range.end == -1) range.end = context.file.length() - 1;
    range.length = range.end - range.start + 1;
    return range.length;
  }
1272942
public void calcAutoScale() {
        double maxNoOfMajorTicks = 10;
        double maxNoOfMinorTicks = 10;
        double minValue          = getMinValue();
        double maxValue          = getMaxValue();
        double range             = maxValue - minValue;
        double niceRange         = (Helper.calcNiceNumber(range, false));
        setMajorTickSpace(Helper.calcNiceNumber(niceRange / (maxNoOfMajorTicks - 1), true));
        double niceMinValue      = (Math.floor(minValue / getMajorTickSpace()) * getMajorTickSpace());
        double niceMaxValue      = (Math.ceil(maxValue / getMajorTickSpace()) * getMajorTickSpace());
        setMinorTickSpace(Helper.calcNiceNumber(getMajorTickSpace() / (maxNoOfMinorTicks - 1), true));
        setMinValue(niceMinValue);
        setMaxValue(niceMaxValue);
    }
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
480525
def range(start, finish, step):
        """"""
        value = start
        while value <= finish:
            yield value
            value += step
213903
def calculateRange(self, values):
        
        vals = filter(lambda x: x is not None, values)
        
        try:
            min_val = min(min(vals), 0)
        except ValueError:
            min_val = 0
        
        try:
            max_val = max(max(vals), 0)
        except ValueError:
            max_val = 10
        
        ndigits  = max(len(nativestring(abs(int(min_val)))), len(nativestring(abs(int(max_val)))))
        rounding = 10 ** (ndigits - 1)
        
        self.setRoundTo(rounding)
        self.setMinimum(self.rounded(min_val, rounding))
        self.setMaximum(self.rounded(max_val, rounding))
        self.reset()
1172061
def set_range(self, bounds, keep_aspect=False):
        """"""
        # a * (v0 + t) = -1
        # a * (v1 + t) = +1
        # =>
        # a * (v1 - v0) = 2
        bounds = np.asarray(bounds, dtype=np.float64)
        v0 = bounds[:2]
        v1 = bounds[2:]
        pan = -.5 * (v0 + v1)
        zoom = 2. / (v1 - v0)
        if keep_aspect:
            zoom = zoom.min() * np.ones(2)
        self.set_pan_zoom(pan=pan, zoom=zoom)
425021
public static boolean inRange(Range range, double val) {
        return val >= range.min() && val <= range.max();
    }
453671
def get_range_info(array, component):
    """"""
    r = array.GetRange(component)
    comp_range = {}
    comp_range['min'] = r[0]
    comp_range['max'] = r[1]
    comp_range['component'] = array.GetComponentName(component)
    return comp_range
940048
private void calculate() {
        if (niceScale) {
            this.niceRange = calcNiceNumber(maxValue - minValue, false);
            this.majorTickSpacing = calcNiceNumber(niceRange / (maxNoOfMajorTicks - 1), true);
            this.niceMinValue = Math.floor(minValue / majorTickSpacing) * majorTickSpacing;
            this.niceMaxValue = Math.ceil(maxValue / majorTickSpacing) * majorTickSpacing;
            this.minorTickSpacing = calcNiceNumber(majorTickSpacing / (maxNoOfMinorTicks - 1), true);
            this.range = niceMaxValue - niceMinValue;
        } else {
            this.niceRange = (maxValue - minValue);
            this.niceMinValue = minValue;
            this.niceMaxValue = maxValue;
            this.range = this.niceRange;
        }
    }
1114757
def _set_range(self, init):
        

        if init and (self._scale_factor is not None):
            return  # We don't have to set our scale factor

        # Get window size (and store factor now to sync with resizing)
        w, h = self._viewbox.size
        w, h = float(w), float(h)

        # Get range and translation for x and y
        x1, y1, z1 = self._xlim[0], self._ylim[0], self._zlim[0]
        x2, y2, z2 = self._xlim[1], self._ylim[1], self._zlim[1]
        rx, ry, rz = (x2 - x1), (y2 - y1), (z2 - z1)

        # Correct ranges for window size. Note that the window width
        # influences the x and y data range, while the height influences
        # the z data range.
        if w / h > 1:
            rx /= w / h
            ry /= w / h
        else:
            rz /= h / w

        # Convert to screen coordinates. In screen x, only x and y have effect.
        # In screen y, all three dimensions have effect. The idea of the lines
        # below is to calculate the range on screen when that will fit the
        # data under any rotation.
        rxs = (rx**2 + ry**2)**0.5
        rys = (rx**2 + ry**2 + rz**2)**0.5

        self.scale_factor = max(rxs, rys) * 1.04
1086737
def heat_setting(self, value):
        """"""
        if value not in range(0, 4):
            raise exceptions.RoasterValueError

        self._heat_setting.value = value
725942
def range(self) -> str:
        """"""
        if FRAGMENT_MISSING in self:
            return '?'

        return '{}_{}'.format(self[FRAGMENT_START], self[FRAGMENT_STOP])
548278
static long calcInterval(int segments, int start, int limit) {

        long range = limit - start;

        if (range < 0) {
            return 0;
        }

        int partSegment = (range % segments) == 0 ? 0
                                                  : 1;

        return (range / segments) + partSegment;
    }