Returns a position that's within the maximum bounds:
971254
private Coordinate checkPosition(final Coordinate newPosition, final double newResolution) {
		double xCenter = newPosition.getX();
		double yCenter = newPosition.getY();
		if (maxBounds != null) {
			double w = mapWidth * newResolution / 2;
			double h = mapHeight * newResolution / 2;
			Coordinate minCoordinate = BboxService.getOrigin(maxBounds);
			Coordinate maxCoordinate = BboxService.getEndPoint(maxBounds);

			if ((w * 2) > maxBounds.getWidth()) {
				xCenter = BboxService.getCenterPoint(maxBounds).getX();
			} else {
				if ((xCenter - w) < minCoordinate.getX()) {
					xCenter = minCoordinate.getX() + w;
				}
				if ((xCenter + w) > maxCoordinate.getX()) {
					xCenter = maxCoordinate.getX() - w;
				}
			}
			if ((h * 2) > maxBounds.getHeight()) {
				yCenter = BboxService.getCenterPoint(maxBounds).getY();
			} else {
				if ((yCenter - h) < minCoordinate.getY()) {
					yCenter = minCoordinate.getY() + h;
				}
				if ((yCenter + h) > maxCoordinate.getY()) {
					yCenter = maxCoordinate.getY() - h;
				}
			}
		}
		return new Coordinate(xCenter, yCenter);
	}
184289
public float getBoundsDepth() {
        if (mSceneObject != null) {
            GVRSceneObject.BoundingVolume v = mSceneObject.getBoundingVolume();
            return v.maxCorner.z - v.minCorner.z;
        }
        return 0f;
    }
29546
function bound(val, min, max) {
    // trim the value to be within min..max (if min..max are specified)
    val = (min !== undefined)? Math.max(val, min) : val;
    val = (max !== undefined)? Math.min(val, max) : val;
    return val ;
}
857843
def range(self, axis=None):
        
        return (self.min(axis=axis), self.max(axis=axis))
669829
function getbounds( el ) {
			el = $(el);
			var offset = el.offset();
			
			var bounds = {	
					left:offset.left,
					right:offset.left+el.outerWidth(),
					top:offset.top,
					bottom:offset.top+el.outerHeight()
					}
			
			return bounds;	
		}
316177
def coordinates_inside_data(
        self,
        x,
        y
        ):

        

        return (self.min_x <= x < self.max_x) and (self.min_y <= y < self.max_y)
992930
def _get_pos(self):
        
        if self._canvas.height >= self._max_height:
            return 0
        else:
            return self._canvas.start_line / (self._max_height - self._canvas.height + 1)
763292
def max(self):
        
        return round(np.max(self.array), self.precision)\
            if len(self.array) else None
433655
public int findClosest( P p , double maxDistance ) {
		int best = -1;
		bestDistance = maxDistance;

		for( int i = 0; i < points.size(); i++ ) {
			P c = points.get(i);

			double distanceC = distance.distance(p,c);

			if( distanceC <= bestDistance ) {
				bestDistance = distanceC;
				best = i;
			}
		}

		return best;
	}
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)
  );
}
1143186
def _select_position(self, w, h): 
        
        fitn = ((m.y+h, m.x, w, h, m) for m in self._max_rects 
                if self._rect_fitness(m, w, h) is not None)
        fitr = ((m.y+w, m.x, h, w, m) for m in self._max_rects 
                if self._rect_fitness(m, h, w) is not None)

        if not self.rot:
            fitr = []

        fit = itertools.chain(fitn, fitr)
        
        try:
            _, _, w, h, m = min(fit, key=first_item)
        except ValueError:
            return None, None

        return Rectangle(m.x, m.y, w, h), m
1334287
def get_maximum(self, other):
        """"""
        return Point(max(self.x, other.x), max(self.y, other.y))
143643
private int rightmostIndexBelowMax() {
		for (int i = r-1; i>=0; i--)
			if (index[i] < n - r + i) return i;
		return -1;
	}
1290350
def get_position(self):
        
        with self._lock:
            return self.x, self.y, self.angle
816828
public int getNodeByPosition(int position)
  {
    if (position > 0) {
      final int pos = isReverse() ? getLast() - position + 1
                                   : position;
      int node;
      while ((node = next()) != DTMAxisIterator.END) {
        if (pos == getPosition()) {
          return node;
        }
      }
    }
    return END;
  }
1284937
def y_max(self):
        """"""
        end_y = max(y for y, *_ in self.iterator())

        if self.combined:
            end_y += self.group_offset

        return end_y + 2 * self.group_offset
665545
def D(self):
        '''
        
        '''
        return Point(self.minX, self.maxY, self.origin.z)