Check if rectangle is infinite.
511424
def isInfinite(self):
        """"""
        return self.x0 > self.x1 or self.y0 > self.y1
297229
def exists(self):
        
        limit = self.limit_

        result = self.limit(1).count() > 0

        self.limit(limit)

        return result
1226943
private void checkForFinalBoundary(String boundaryLine) throws IOException {
    if (boundaryLine.equals(boundary + "--")) {
      hasNext = false;
      inputStream.close();
    }
  }
1292109
def _rectangular(n):
    """"""
    for i in n:
        if len(i) != len(n[0]):
            return False
    return True
515864
def isfinite(data: mx.nd.NDArray) -> mx.nd.NDArray:
    
    is_data_not_nan = data == data
    is_data_not_infinite = data.abs() != np.inf
    return mx.nd.logical_and(is_data_not_infinite, is_data_not_nan)
528492
def unbounded(self):
        """"""
        self._check_valid()

        status = self._problem._p.Status
        if (status == gurobipy.GRB.INF_OR_UNBD and
                self._problem._p.params.DualReductions):
            # Disable dual reductions to obtain a definitve answer
            self._problem._p.params.DualReductions = 0
            try:
                self._problem._p.optimize()
            finally:
                self._problem._p.params.DualReductions = 1

            status = self._problem._p.Status
        return status == gurobipy.GRB.UNBOUNDED
518162
public boolean intersects(Rectangle2D r) {
		if(np==0)return false;
		Line2D line = new Line2D.Double(x[0],y[0],x[0],y[0]);
		for (int i = 1; i < np; i++) {
			line.setLine(x[i-1], y[i-1], x[i], y[i]);
			if(line.intersects(r))return true;
		}
		return false;
	}
4883
private Rectangle extendRect(Rectangle rect, boolean horizontal) {
        if (rect == null) {
            return rect;
        }

        if (horizontal) {
            rect.x     = 0;
            rect.width = table.getWidth();
        } else {
            rect.y = 0;

            if (table.getRowCount() != 0) {
                Rectangle lastRect = table.getCellRect(table.getRowCount() - 1, 0, true);

                rect.height = lastRect.y + lastRect.height;
            } else {
                rect.height = table.getHeight();
            }
        }

        return rect;
    }
918093
def is_finite(self):
        """"""
        return (self.num_stores == 2 and
                self.state == 0 and self.has_cell(0) and
                self.input == 1 and self.has_input(1))
623044
def has_end(self, stream):
        
        for token in self.end_tokens:
            if not self.has_next(token, stream):
                continue

            offset = len(token)

            if self.has_eof(stream, offset):
                return True

            if self.has_whitespace(stream, offset):
                return True

            if self.has_comment(stream, offset):
                return True

            if self.has_next(self.statement_delimiter, stream, offset):
                return True

        return self.has_eof(stream)
1191752
private int countAreas(Area a, Rectangular r)
    {
        int ret = 0;
        
        for (int i = 0; i < a.getChildCount(); i++)
        {
            Area n = a.getChildAt(i);
            if (a.getTopology().getPosition(n).intersects(r))
                ret++;
        }
        return ret;
    }
7126
private Rectangle fixRectangle(Rectangle rectangle, int baseWidth, int baseHeight) {
		if (this.positionBaseCentre) {
			// 修正图片位置从背景的中心计算
			rectangle.setLocation(//
					rectangle.x + (int) (Math.abs(baseWidth - rectangle.width) / 2), //
					rectangle.y + (int) (Math.abs(baseHeight - rectangle.height) / 2)//
			);
		}
		return rectangle;
	}
1334387
def rectangle(self, x, y, width, height, corner_radius = 0):
        """"""
        if corner_radius <= 0:
            self._add_instruction("rectangle", x, y, width, height)
            return

        # convert into 4 border and  make sure that w + h are larger than 2 * corner_radius
        if isinstance(corner_radius, (int, float)):
            corner_radius = [corner_radius] * 4
        corner_radius = [min(r, min(width, height) / 2) for r in corner_radius]

        x2, y2 = x + width, y + height
        self._rounded_rectangle(x, y, x2, y2, corner_radius)
1333083
def _is_in_restart(self, x, y):
        """"""
        x1, y1, x2, y2 = self._new_game
        return x1 <= x < x2 and y1 <= y < y2
1318956
def unbounded(self):
        """"""
        self._check_valid()
        return (self._problem._p.get_status() ==
                qsoptex.SolutionStatus.UNBOUNDED)
925940
def contains(self, rect):
        
        return (rect.y >= self.y and \
                rect.x >= self.x and \
                rect.y+rect.height <= self.y+self.height and \
                rect.x+rect.width  <= self.x+self.width)
897504
protected Rectangle applyClip(Shape current, Rectangle newclip)
    {
        if (current == null)
            return newclip;
        else
        {
            if (current instanceof Rectangle)
                return ((Rectangle) current).intersection(newclip);
            else
                return current.getBounds().intersection(newclip);
        }
    }