Determines if the given layer is a rectangular layer
558680
function isRectLayer(layer) {
	var method = layer._method;
	return (method === $.fn.drawRect || method === $.fn.drawEllipse || method === $.fn.drawImage);
}
1270492
public boolean isIntersectingNE(Envelope2D other) {
		return ((xmin <= other.xmin) ? xmax >= other.xmin : other.xmax >= xmin)
				&& // check that x projections overlap
				((ymin <= other.ymin) ? ymax >= other.ymin : other.ymax >= ymin); // check
																					// that
																					// y
																					// projections
																					// overlap
	}
173532
def validate_packing(self):
        
        surface = Rectangle(0, 0, self.width, self.height)

        for r in self:
            if not surface.contains(r):
                raise Exception("Rectangle placed outside surface")

        
        rectangles = [r for r in self]
        if len(rectangles) <= 1:
            return

        for r1 in range(0, len(rectangles)-2):
            for r2 in range(r1+1, len(rectangles)-1):
                if rectangles[r1].intersects(rectangles[r2]):
                    raise Exception("Rectangle collision detected")
887347
def is_bool_matrix(l):
    

    """
    if isinstance(l, np.ndarray):
        if l.ndim == 2 and (l.dtype == bool):
            return True
    return False
1008632
public final Shape<?> findShapeAtPoint(final int x, final int y)
    {
        if (isVisible())
        {
            final NFastArrayList<Layer> layers = getChildNodes();

            if (null != layers)
            {
                final int size = layers.size();

                for (int i = size - 1; i >= 0; i--)
                {
                    final Layer layer = layers.get(i);

                    if (null != layer)
                    {
                        final Shape<?> shape = layer.findShapeAtPoint(x, y);

                        if (null != shape)
                        {
                            return shape;
                        }
                    }
                }
            }
        }
        return null;
    }
1184574
private boolean isIntersect(double z0, double z1, double zc) {
        if ((z0 - zc) * (z1 - zc) < 0.0) {
            return true;
        }

        return false;
    }
253909
function layerContainsImage (layer, imageUrl) {
  // Check the layer itself.
  if (layer.type === 'image' && layer.imageUrl === imageUrl) {
    return layer;
  }

  // Check the layer's children.
  if (layer.children) {
    for (var i=0, len=layer.children.length; i < len; i++) {
      if (layerContainsImage(layer.children[i], imageUrl)) {
        return layer.children[i];
      }
    }
  }

  return false;
}
1264878
def _check_layer_count(self, layer):
        
        if layer:
            if not layer.isValid():
                raise ImpactReport.LayerException('Layer is not valid')
            if isinstance(layer, QgsRasterLayer):
                # can't check feature count of raster layer
                return
            feature_count = len([f for f in layer.getFeatures()])
            if feature_count == 0:
                raise ImpactReport.LayerException(
                    'Layer contains no features')
106637
@Override
    protected boolean isAfter(int x, int y, Rectangle innerAlloc)
    {
        // System.err.println("isAfter: " + innerAlloc + " my bounds " +
        // box.getAbsoluteBounds());
        // System.err.println("XY: " + x + " : " + y);
        innerAlloc.setBounds(box.getAbsoluteBounds());
        if (majorAxis == View.X_AXIS)
        {
            return (x > (innerAlloc.width + innerAlloc.x));
        }
        else
        {
            return (y > (innerAlloc.height + innerAlloc.y));
        }
    }
87111
function assignLayerCandidate(vertices, incoming, outgoing, W, c, getTo) {
  const layerBelow = new Set()
  const assigned = new Set()
  const layers = [new Set()]

  let widthCurrent = 0
  let widthUp = 0

  while (assigned.size !== vertices.size) {
    let selected = null
    let selectedDegree = -Infinity
    let okay = true
    for (let vertex of vertices) {
      if (assigned.has(vertex)) {
        continue
      }
      let vertexOutgoing = outgoing.get(vertex) || φ

      okay = true

      // N+G(v) ⊆ Z
      for (let edge of vertexOutgoing) {
        if (!layerBelow.has(getTo(edge))) {
          okay = false
          break
        }
      }

      if (!okay && vertexOutgoing.size) continue

      if (selectedDegree < vertexOutgoing.size) {
        selectedDegree = vertexOutgoing.size
        selected = vertex
      }
    }

    if (selected) {
      layers[layers.length - 1].add(selected)
      assigned.add(selected)
      widthCurrent = widthCurrent - selectedDegree + 1
      widthUp = widthUp + (incoming.get(selected) || φ).size
    }

    if (!selected || (widthCurrent >= W && selectedDegree < 1) || widthUp >= W * c) {
      widthCurrent = widthUp
      widthUp = 0
      layers.push(new Set())
      for (let vertex of layers[layers.length - 2]) {
        layerBelow.add(vertex)
      }
    }
  }

  return layers
}
665756
public static boolean isMatrix(DataBuffer shapeInfo) {
        int rank = Shape.rank(shapeInfo);
        if (rank != 2)
            return false;
        return !isVector(shapeInfo);
    }
638499
def is_polygon_layer(layer):
    
    try:
        return (layer.type() == QgsMapLayer.VectorLayer) and (
            layer.geometryType() == QgsWkbTypes.PolygonGeometry)
    except AttributeError:
        return False
1185831
def is_solved(self):
        
        if self.cube.D == [[Square(self.cube["D"].colour)] * 3] * 3:
            for face in "LFRB":
                if self.cube.get_face(face)[1:] != [[Square(self.cube[face].colour)] * 3] * 2:
                    return False
            return True
        return False
1336643
def has_layer(fcollection):
    """"""
    for val in six.viewvalues(fcollection):
        if has_features(val):
            return True
    return False
721390
public boolean almostParallel(SquareNode a , int sideA , SquareNode b , int sideB ) {
		double selected = acuteAngle(a,sideA,b,sideB);

		if( selected > parallelThreshold )
			return false;

		// see if the two sides are about parallel too
//		double left = acuteAngle(a,add(sideA,-1),b,add(sideB,1));
//		double right = acuteAngle(a,add(sideA,1),b,add(sideB,-1));
//
//		if( left > selected+parallelThreshold || right > selected+parallelThreshold )
//			return false;


//		if( selected >  acuteAngle(a,sideA,b,add(sideB,1)) || selected >  acuteAngle(a,sideA,b,add(sideB,-1)) )
//			return false;
//
//		if( selected >  acuteAngle(a,add(sideA,1),b,sideB) || selected >  acuteAngle(a,add(sideA,-1),b,sideB) )
//			return false;

		return true;
	}
236944
private boolean checkEdgeCount( SquareGrid grid ) {

		int left = 0, right = grid.columns-1;
		int top = 0, bottom = grid.rows-1;

		for (int row = 0; row < grid.rows; row++) {
			boolean skip = grid.get(row,0) == null;

			for (int col = 0; col < grid.columns; col++) {
				SquareNode n = grid.get(row,col);
				if( skip ) {
					if ( n != null )
						return false;
				} else {
					boolean horizontalEdge =  col == left || col == right;
					boolean verticalEdge =  row == top || row == bottom;

					boolean outer = horizontalEdge || verticalEdge;
					int connections = n.getNumberOfConnections();

					if( outer ) {
						if( horizontalEdge && verticalEdge ) {
							if( connections != 1 )
								return false;
						} else if( connections != 2 )
							return false;
					} else {
						if( connections != 4 )
							return false;
					}
				}
				skip = !skip;
			}
		}
		return true;
	}
351737
def has_layer(self, class_: Type[L], became: bool=True) -> bool:
        

        return (class_ in self._index or
                (became and class_ in self._transformed))