Returns whether the given shape is a vector

@param shape the shape to test
@return whether the given shape is a vector
425317
public static boolean isVector(int[] shape) {
        if (shape.length > 2 || shape.length < 1)
            return false;
        else {
            long len = ArrayUtil.prodLong(shape);
            return shape[0] == len || shape[1] == len;
        }
    }
1193368
public static boolean isPlaceholderShape(int[] shape) {
        if(shape == null)
            return true;
        else {
            for(int i = 0; i < shape.length; i++) {
                if(shape[i] < 0)
                    return true;
            }
        }

        return false;
    }
401885
@Override
	@Pure
	public boolean intersects(Shape2D<?, ?, ?, ?, ?, ? extends Rectangle2afp<?, ?, ?, ?, ?, ?>> rectangle) {
		if (boundsIntersects(rectangle)) {

			if (rectangle.intersects(getBoundingBox())) {
				return true;
			}

			if (this.isWidePolyline) {
				final Rectangle2afp<?, ?, ?, ?, ?, ?> box = rectangle.toBoundingBox();
				final double rminX = box.getMinX();
				final double rminY = box.getMinY();
				final double rmaxX = box.getMaxX();
				final double rmaxY = box.getMaxY();

				final double width = getWidth();

				boolean firstPoint;
				double px = 0;
				double py = 0;

				for (final PointGroup grp : groups()) {
					firstPoint = true;
					for (final Point2d pts : grp) {
						final double x = pts.getX();
						final double y = pts.getY();

						if (firstPoint) {
							firstPoint = false;
						} else if (MathUtil.min(
								Segment2afp.calculatesDistanceSquaredSegmentSegment(rminX, rmaxY, rmaxX, rmaxY, px, py, x, y),
								Segment2afp.calculatesDistanceSquaredSegmentSegment(rminX, rminY, rminX, rmaxY, px, py, x, y),
								Segment2afp.calculatesDistanceSquaredSegmentSegment(rmaxX, rminY, rmaxX, rmaxY, px, py, x, y))
								<= width * width) {
							return true;
						}

						px = x;
						py = y;
					}
				}
			} else {
				return toPath2D().intersects(rectangle);
			}
		}
		return false;
	}
1206498
public static boolean validFill(Shape shape) {
    	if (shape.getTriangles() == null) {
    		return false;
    	}
        return shape.getTriangles().getTriangleCount() != 0;
    }
619541
@Override
    public INDArray ones(int[] shape) {
        INDArray ret = createUninitialized(shape, Nd4j.order());
        ret.assign(1);
        return ret;
    }
123593
@SuppressWarnings("unchecked")
    static <T> Node<T> emptyNode(StreamShape shape) {
        switch (shape) {
            case REFERENCE:    return (Node<T>) EMPTY_NODE;
            case INT_VALUE:    return (Node<T>) EMPTY_INT_NODE;
            case LONG_VALUE:   return (Node<T>) EMPTY_LONG_NODE;
            case DOUBLE_VALUE: return (Node<T>) EMPTY_DOUBLE_NODE;
            default:
                throw new IllegalStateException("Unknown shape " + shape);
        }
    }
199399
public boolean isEdge(GeometryIndex index) {
		if (index.hasChild()) {
			return isEdge(index.getChild());
		}
		return index.getType() == GeometryIndexType.TYPE_EDGE;
	}
815092
public static boolean isRowVectorShape(IntBuffer shapeInfo) {
        int rank = Shape.rank(shapeInfo);
        IntBuffer shape = Shape.shapeOf(shapeInfo);
        return (rank == 2 && shape.get(0) == 1) || rank == 1;

    }
453956
public boolean isValid() {

        boolean valid = true;

        switch (shapeType) {

            case POLYLINE_MARKERS:
                valid = ((PolylineMarkers) shape).isValid();
                break;
            case POLYGON_MARKERS:
                valid = ((PolygonMarkers) shape).isValid();
                break;
            case MULTI_POLYLINE_MARKERS:
                valid = ((MultiPolylineMarkers) shape).isValid();
                break;
            case MULTI_POLYGON_MARKERS:
                valid = ((MultiPolygonMarkers) shape).isValid();
                break;
            case COLLECTION:
                @SuppressWarnings("unchecked")
                List<GoogleMapShape> shapeList = (List<GoogleMapShape>) shape;
                for (GoogleMapShape shapeListItem : shapeList) {
                    valid = shapeListItem.isValid();
                    if (!valid) {
                        break;
                    }
                }
                break;
            default:
        }

        return valid;
    }
739604
public boolean contains(Vector3 p) {
		boolean ans = false;
		if(this.halfplane || p== null) return false;

		if (isCorner(p)) {
			return true;
		}

		PointLinePosition a12 = PointLineTest.pointLineTest(a,b,p);
		PointLinePosition a23 = PointLineTest.pointLineTest(b,c,p);
		PointLinePosition a31 = PointLineTest.pointLineTest(c,a,p);

		if ((a12 == PointLinePosition.LEFT && a23 == PointLinePosition.LEFT && a31 == PointLinePosition.LEFT ) ||
				(a12 == PointLinePosition.RIGHT && a23 == PointLinePosition.RIGHT && a31 == PointLinePosition.RIGHT ) ||
				(a12 == PointLinePosition.ON_SEGMENT ||a23 == PointLinePosition.ON_SEGMENT ||  a31 == PointLinePosition.ON_SEGMENT)) {
			ans = true;
		}

		return ans;
	}
14913
public static long[] squeeze(long[] shape) {
        if (isColumnVectorShape(shape))
            return shape;

        List<Long> ret = new ArrayList<>();

        //strip all but last dimension
        for (int i = 0; i < shape.length; i++)
            if (shape[i] != 1)
                ret.add(shape[i]);
        return ArrayUtil.toArrayLong(ret);
    }
1005526
def is_valid_shape(value):
    """"""
    if is_int_positive(value):
        return True, value
    elif isinstance(value, tuple) or isinstance(value, list):
        for v in value:
            if not is_int_positive(v):
                return False, value
        return True, value
    else:
        return False, value
1278709
@ExportInstanceMethod
	public static void setShape(PointSymbolizerShapeAndSize instance, String shape) {
		if ("circle".equals(shape)) {
			instance.setShape(PointSymbolizerShapeAndSize.Shape.CIRCLE);
		} else if ("square".equals(shape)) {
			instance.setShape(PointSymbolizerShapeAndSize.Shape.SQUARE);
		} else {
			//default value
			instance.setShape(PointSymbolizerShapeAndSize.Shape.SQUARE);
		}
	}
928924
@Override
    public INDArray valueArrayOf(int[] shape, double value) {
        INDArray ret = Nd4j.createUninitialized(shape, Nd4j.order());
        ret.assign(value);
        return ret;
    }
561712
@Override
	@Pure
	public boolean intersects(Shape2D<?, ?, ?, ?, ?, ? extends Rectangle2afp<?, ?, ?, ?, ?, ?>> rectangle) {
		if (boundsIntersects(rectangle)) {
			final double x = getX();
			final double y = getY();
			final Rectangle2afp<?, ?, ?, ?, ?, ?> box = rectangle.toBoundingBox();
			final double minx = box.getMinX();
			final double miny = box.getMinY();
			final double maxx = box.getMaxX();
			final double maxy = box.getMaxY();

			return MathUtil.min(
					Segment2afp.calculatesDistanceSegmentPoint(minx, miny, maxx, miny, x, y),
					Segment2afp.calculatesDistanceSegmentPoint(minx, miny, minx, maxy, x, y),
					Segment2afp.calculatesDistanceSegmentPoint(maxx, miny, maxx, maxy, x, y),
					Segment2afp.calculatesDistanceSegmentPoint(minx, maxy, maxx, maxy, x, y)) <= this.radius;
		}
		return false;
	}
1267124
public static final void fill(Shape shape) {
    	if (!validFill(shape)) {
    		return;
    	}
    	
        Texture t = TextureImpl.getLastBind();
        TextureImpl.bindNone();
        
    	fill(shape, new PointCallback() {
			public float[] preRenderPoint(Shape shape, float x, float y) {
				// do nothing, we're just filling the shape this time
				return null;
			}
    	});
        
        if (t == null) {
        	TextureImpl.bindNone();
        } else {
        	t.bind();
        }
    }
673675
public Line getLine(Shape shape, int s, int e) {
		float[] start = shape.getPoint(s);
		float[] end = shape.getPoint(e);
		
		Line line = new Line(start[0],start[1],end[0],end[1]);
		return line;
	}