Returns true if the given side of a box is after the given coordinates, in top-to-bottom, left-to-right order.
517302
function boxIsAfter(box, x, y, left) {
  return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x
}
729516
def contains_exclusive(self, x, y):
        
        left, bottom, right, top = self._aarect.lbrt()
        return (left <= x < right) and (bottom < y <= top)
941420
protected int isBetter3D(Box a, Box b, Space space) {
		int compare = Long.compare(a.getVolume(), b.getVolume());
		if(compare != 0) {
			return compare;
		}
		// determine lowest fit
		a.fitRotate3DSmallestFootprint(space);
		b.fitRotate3DSmallestFootprint(space);

		return Long.compare(b.getFootprint(), a.getFootprint()); // i.e. smaller i better
	}
812024
public static boolean detectCicular(List<Location> subLocations) {
		boolean isCircular = false;
		if(! consistentAccessions(subLocations))
			return isCircular;

		int lastMax = 0;
		for (Location sub : subLocations) {
			if (sub.getEnd().getPosition() > lastMax) {
				lastMax = sub.getEnd().getPosition();
			}
			else {
				isCircular = true;
				break;
			}
		}
		return isCircular;
	}
1176905
def is_after(self, ts):
        '''  '''
        if self.timestamp >= int(calendar.timegm(ts.timetuple())):
            return True
        return False
656891
def same_position?(pos1, pos2)
      return unless pos1 && pos2
      pos1.line == pos2.line && pos1.offset == pos2.offset
    end
443918
def get_position(self):
        """"""
        rect = _Rect()
        GetWindowRect(self._hwnd, ctypes.pointer(rect))
        return rect.left, rect.top, rect.right, rect.bottom
109537
def contains_point?(pt)
      pt.x.between?(left, left + width - 1) &&
        pt.y.between?(top, top + height - 1)
    end
839192
function(x, y){
            var pos = this.canvas.getBoundingClientRect(),
                mx = x - pos.left,
                my = y - pos.top;
            return this.pixelToTileCoords(mx, my);
        }
109629
def element_coordinates(cls, element):
        
        out = (0, 0, 0, 0)
        if 'title' in element.attrib:
            matches = cls.box_pattern.search(element.attrib['title'])
            if matches:
                coords = matches.group(1).split()
                out = Rect._make(int(coords[n]) for n in range(4))
        return out
981842
public static final boolean isInside(int x, int y, Rect box) {
        return (box.x < x && x < box.x + box.w && box.y < y && y < box.y + box.h);
    }
1374408
boolean orderNodes( FastQueue<Node> corners , GridInfo info ) {

		// Find a node with just two edges. This is a corner and will be the arbitrary origin in our graph
		Node seed = null;
		for (int i = 0; i < corners.size; i++) {
			Node n = corners.get(i);
			if( n.countEdges() == 2 ) {
				seed = n;
				break;
			}
		}
		if( seed == null ) {
			if( verbose != null ) verbose.println("Can't find a corner with just two edges. Aborting");
			return false;
		}

		// find one edge and mark that as the row direction
		int rowEdge = 0;
		while( seed.edges[rowEdge] == null )
			rowEdge = (rowEdge+1)%4;
		int colEdge = (rowEdge+1)%4;
		while( seed.edges[colEdge] == null )
			colEdge = (colEdge+2)%4;

		// if it's left handed swap the row and column direction
		if( !isRightHanded(seed,rowEdge,colEdge)) {
			int tmp = rowEdge;
			rowEdge = colEdge;
			colEdge = tmp;
		}

		// add the corns to list in a row major order
		while( seed != null ) {
			int before = info.nodes.size();
			Node n = seed;
			do {
				info.nodes.add(n);
				n = n.edges[colEdge];
			} while( n != null );

			seed = seed.edges[rowEdge];

			if( info.cols == -1 ) {
				info.cols = info.nodes.size();
			} else {
				int columnsInRow = info.nodes.size()-before;
				if( columnsInRow != info.cols ) {
					if( verbose != null ) verbose.println("Number of columns in each row is variable");
					return false;
				}
			}
		}
		info.rows = info.nodes.size()/info.cols;
		return true;
	}
611732
def _comp_bbox(el, el2):
    
    # only compare if both elements have x/y coordinates
    if _comp_bbox_keys_required <= set(el.keys()) and \
            _comp_bbox_keys_required <= set(el2.keys()):
        if _box_in_box(el2, el):
            return 1
        if _box_in_box(el, el2):
            return -1
    return 0
754601
public static Boolean isAscendingOrder(String sorting) {
        return "desc".equalsIgnoreCase(sorting) ? Boolean.FALSE : Boolean.TRUE;
    }
846823
public static boolean checkCollision(CmsPositionBean posA, CmsPositionBean posB, int margin) {

        // check for non collision is easier
        if ((posA.getLeft() - margin) >= (posB.getLeft() + posB.getWidth())) {
            // posA is right of posB
            return false;
        }
        if ((posA.getLeft() + posA.getWidth()) <= (posB.getLeft() - margin)) {
            // posA is left of posB
            return false;
        }
        if ((posA.getTop() - margin) >= (posB.getTop() + posB.getHeight())) {
            // posA is bellow posB
            return false;
        }
        if ((posA.getTop() + posA.getHeight()) <= (posB.getTop() - margin)) {
            // posA is above posB
            return false;
        }

        // in any other case the position rectangles collide
        return true;
    }
669570
function _getBoundingBox (result) {
  if (!result.viewport) {
    return;
  }
  const upperLeft = result.viewport.topLeftPoint;
  const bottomRight = result.viewport.btmRightPoint;

  return {
    south: bottomRight.lat,
    west: upperLeft.lon,
    north: upperLeft.lat,
    east: bottomRight.lon
  };
}
775347
def get_coord_box(centre_x, centre_y, distance):
    """Todo: return coordinates inside a circle, rather than a square"""
    return {
        'top_left': (centre_x - distance, centre_y + distance),
        'top_right': (centre_x + distance, centre_y + distance),
        'bottom_left': (centre_x - distance, centre_y - distance),
        'bottom_right': (centre_x + distance, centre_y - distance),
    }