Gets the (min, max) range of solutions for an address.
774087
def _range(self, memory, addr, **kwargs):
        
        return (self._min(memory, addr, **kwargs), self._max(memory, addr, **kwargs))
491898
function find_range($data, $min, $max, $resolution) {
      if (sizeof($data) == 0 ) return array('min' => 0, 'max' => 0);
      foreach ($data as $key => $value) {
        if ($value=='none') continue;
        if ($value > $max) $max = $value;
        if ($value < $min) $min = $value;
      }

      if ($max == 0) {
        $factor = 1;
      } else {
        if ($max < 0) $factor = - pow(10, (floor(log10(abs($max))) + $resolution) );
        else $factor = pow(10, (floor(log10(abs($max))) - $resolution) );
      }
      if ($factor > 0.1) { // To avoid some wierd rounding errors (Moodle)
        $factor = round($factor * 1000.0) / 1000.0; // To avoid some wierd rounding errors (Moodle)
      } // To avoid some wierd rounding errors (Moodle)

      $max = $factor * @ceil($max / $factor);
      $min = $factor * @floor($min / $factor);

      //print "max=$max, min=$min<br />";

      return array('min' => $min, 'max' => $max);
    }
55773
function getDirectionPositionForRange (value, min, max, orientation) {
  return isVertical(orientation) ? (
    // as upper value is used to calculate `top`;
    Math.round(((max - value[1]) / max - min) * 100)
  ) : (
    Math.round((value[0] / max - min) * 100)
  );
}
57595
private ArrayList<String> calculateRangeFromParameters(){
        ArrayList<String>allTheValues = new ArrayList<String>();
        int minSampleSizeInteger = Integer.parseInt(minSampleSize);
        int maxSampleSizeInteger = Integer.parseInt(maxSampleSize);
        int incrementInteger = Integer.parseInt(increment);
        for(int i=minSampleSizeInteger; i<maxSampleSizeInteger; i=i+incrementInteger){
            String value = Integer.toString(i) + " - " + Integer.toString(i+incrementInteger);
            allTheValues.add(value);
        }
        return allTheValues;
    }
944182
def range_by_score(self, min, max):
        """"""
        data = self.items()
        keys = [r[1] for r in data] 
        start = bisect.bisect_left(keys, min)
        end = bisect.bisect_right(keys, max, start)
        return self._as_set()[start:end]
696719
def minimum_address(self):
        

        minimum_address = self._segments.minimum_address

        if minimum_address is not None:
            minimum_address //= self.word_size_bytes

        return minimum_address
520214
public Range getRange() {
    Long rangeMin = getRangeMin();
    Long rangeMax = getRangeMax();
    return rangeMin != null || rangeMax != null ? new Range(rangeMin, rangeMax) : null;
  }
560189
def _max(self):
        """"""
        return (
            self.range[1] if (self.range and self.range[1] is not None) else
            (max(self._values) if self._values else None)
        )
168690
def get_range(self):
        """"""
        p, z = np.asarray(self.pan), np.asarray(self.zoom)
        x0, y0 = -1. / z - p
        x1, y1 = +1. / z - p
        return (x0, y0, x1, y1)
939489
def get_ipv4_range(start_addr=None, end_addr=None, return_fields=None, **api_opts):
    '''
    
    '''
    infoblox = _get_infoblox(**api_opts)
    return infoblox.get_range(start_addr, end_addr, return_fields)
1286459
public int location(S solution) {
    //Create a int [] to store the range of each objective
    int[] position = new int[numberOfObjectives];

    //Calculate the position for each objective
    for (int obj = 0; obj < numberOfObjectives; obj++) {
      if ((solution.getObjective(obj) > gridUpperLimits[obj])
              || (solution.getObjective(obj) < gridLowerLimits[obj])) {
        return -1;
      } else if (solution.getObjective(obj) == gridLowerLimits[obj]) {
        position[obj] = 0;
      } else if (solution.getObjective(obj) == gridUpperLimits[obj]) {
        position[obj] = ((int) Math.pow(2.0, bisections)) - 1;
      } else {
        double tmpSize = divisionSize[obj];
        double value = solution.getObjective(obj);
        double account = gridLowerLimits[obj];
        int ranges = (int) Math.pow(2.0, bisections);
        for (int b = 0; b < bisections; b++) {
          tmpSize /= 2.0;
          ranges /= 2;
          if (value > (account + tmpSize)) {
            position[obj] += ranges;
            account += tmpSize;
          }
        }
      }
    }

    //Calculate the location into the hypercubes
    int location = 0;
    for (int obj = 0; obj < numberOfObjectives; obj++) {
      location += position[obj] * Math.pow(2.0, obj * bisections);
    }
    return location;
  }
653139
public Range getAbsoluteRangeFor(Range relativeRange) {
        int from = convertBoundaryToAbsolutePosition(relativeRange.getFrom()),
                to = convertBoundaryToAbsolutePosition(relativeRange.getTo());
        return new Range(from, to);
    }
679417
def _get_min_max_value(min, max, value=None, step=None):
    """"""
    # Either min and max need to be given, or value needs to be given
    if value is None:
        if min is None or max is None:
            raise ValueError('unable to infer range, value from: ({0}, {1}, {2})'.format(min, max, value))
        diff = max - min
        value = min + (diff / 2)
        # Ensure that value has the same type as diff
        if not isinstance(value, type(diff)):
            value = min + (diff // 2)
    else:  # value is not None
        if not isinstance(value, Real):
            raise TypeError('expected a real number, got: %r' % value)
        # Infer min/max from value
        if value == 0:
            # This gives (0, 1) of the correct type
            vrange = (value, value + 1)
        elif value > 0:
            vrange = (-value, 3*value)
        else:
            vrange = (3*value, -value)
        if min is None:
            min = vrange[0]
        if max is None:
            max = vrange[1]
    if step is not None:
        # ensure value is on a step
        tick = int((value - min) / step)
        value = min + tick * step
    if not min <= value <= max:
        raise ValueError('value must be between min and max (min={0}, value={1}, max={2})'.format(min, value, max))
    return min, max, value
1044699
def _next_address_in_regions(self, address):
        

        if self._inside_regions(address):
            return address

        try:
            return next(self._regions.irange(minimum=address, reverse=False))
        except StopIteration:
            return None
1307580
function indexInRange(index, rangeLength) {
        var range = calculateRange(rangeLength);
        if (index >= range.min && index <= range.max) {
            return true;
        }
        return false;
    }
492372
def _max(self):
        """"""
        return (
            self.range[1] if (self.range and self.range[1] is not None) else
            (max(map(abs, self._values)) if self._values else None)
        )
395521
public function range(int $min=null, int $max=null)
        {
                $min      = is_null($min) ? '-inf' : $min;
                $max      = is_null($max) ? '+inf' : $max;
           
                $response = $this->_redis->zrevrangebyscore($this->_key, $max, $min, 'WITHSCORES');
                $result   = [];
                for($i=0,$num=count($response);$i<$num;$i++) {
                        $result[$response[$i]] = intval($response[++$i]);
                }
                return $result;
        }