Creates an ndarray with the specified shape

@param shape  the shape of the ndarray
@param stride the stride for the ndarray
@param offset the offset of the ndarray
@return the instance
491280
@Override
    public INDArray create(int[] shape, int[] stride, long offset) {
        DataBuffer buffer = Nd4j.createBuffer(ArrayUtil.prodLong(shape));
        return create(buffer, shape, stride, offset);
    }
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);
    }
326062
public static GeneralPath shapeOf(Shape shape, Color color) {
        List<PathElement> elements = new ArrayList<PathElement>();
        PathIterator pathIt = shape.getPathIterator(new AffineTransform());
        double[] data = new double[6];
        while (!pathIt.isDone()) {
            switch (pathIt.currentSegment(data)) {
                case PathIterator.SEG_MOVETO:
                    elements.add(new MoveTo(data));
                    break;
                case PathIterator.SEG_LINETO:
                    elements.add(new LineTo(data));
                    break;
                case PathIterator.SEG_CLOSE:
                    elements.add(new Close());
                    break;
                case PathIterator.SEG_QUADTO:
                    elements.add(new QuadTo(data));
                    break;
                case PathIterator.SEG_CUBICTO:
                    elements.add(new CubicTo(data));
                    break;
            }
            pathIt.next();
        }
        return new GeneralPath(elements, color, pathIt.getWindingRule(), 0d, true);
    }
672442
static List<Point2D> pointsOf(final Shape shape) {
        final List<Point2D> points = new ArrayList<Point2D>();
        final double[] coordinates = new double[6];
        for (PathIterator i = shape.getPathIterator(null); !i.isDone(); i.next()) {
            switch (i.currentSegment(coordinates)) {
                case PathIterator.SEG_CLOSE:
                    break;
                case PathIterator.SEG_MOVETO:
                case PathIterator.SEG_LINETO:
                    points.add(new Point2D.Double(coordinates[0], coordinates[1]));
                    break;
                case PathIterator.SEG_QUADTO:
                    points.add(new Point2D.Double(coordinates[0], coordinates[1]));
                    points.add(new Point2D.Double(coordinates[2], coordinates[3]));
                    break;
                case PathIterator.SEG_CUBICTO:
                    points.add(new Point2D.Double(coordinates[0], coordinates[1]));
                    points.add(new Point2D.Double(coordinates[2], coordinates[3]));
                    points.add(new Point2D.Double(coordinates[4], coordinates[5]));
                    break;
            }
        }

        if (!points.isEmpty() && points.get(points.size() - 1).equals(points.get(0))) {
            points.remove(points.size() - 1);
        }
        return points;
    }
758415
public static int[] squeeze(int[] shape) {
        if (isColumnVectorShape(shape))
            return shape;

        List<Integer> 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.toArray(ret);
    }
545297
private static Shape createArrowShape(int w, int y0, int y1)
    {
        Path2D path = new Path2D.Double();
        path.moveTo(0, y0);
        if ((w & 1) == 0)
        {
            path.lineTo(w>>1, y1);
        }
        else
        {
            int c = w>>1;
            path.lineTo(c, y1);
            path.lineTo(c+1, y1);
        }
        path.lineTo(w, y0);
        path.closePath();
        return path;
    }
194502
@Override
    public INDArray create(List<INDArray> list, int[] shape) {
        return new NDArray(list, shape, Nd4j.getStrides(shape));
    }
339023
static Shape shapeOf(List<Point2D> points) {
        Path2D path = new Path2D.Double();
        if (!points.isEmpty()) {
            path.moveTo(points.get(0).getX(), points.get(0).getY());
            for (Point2D point : points)
                path.lineTo(point.getX(), point.getY());
            path.closePath();
        }
        return path;
    }
479791
def create_rectangle(proto_bits, pulse_len=100):
        
        ones = np.ones(pulse_len, dtype=np.float32) * 1
        zeros = np.ones(pulse_len, dtype=np.float32) * -1
        n = 0
        y = []
        for msg in proto_bits:
            for bit in msg:
                n += pulse_len
                if bit == "0":
                    y.extend(zeros)
                else:
                    y.extend(ones)
        x = np.arange(0, n).astype(np.int64)
        scene = ZoomableScene()
        scene.setSceneRect(0, -1, n, 2)
        scene.setBackgroundBrush(constants.BGCOLOR)
        scene.addLine(0, 0, n, 0, QPen(constants.AXISCOLOR, 0))
        if len(y) > 0:
            y = np.array(y)
        else:
            y = np.array(y).astype(np.float32)
        path = path_creator.array_to_QPath(x, y)
        scene.addPath(path, QPen(constants.LINECOLOR, 0))
        return scene, n
234808
public static void lineStringOffSetCurve(ArrayList<LineString> list, LineString lineString, double offset, BufferParameters bufferParameters) {
        list.add(lineString.getFactory().createLineString(new OffsetCurveBuilder(lineString.getPrecisionModel(), bufferParameters).getOffsetCurve(lineString.getCoordinates(), offset)));
    }
299588
private INDArray gaussianRandomMatrix(long[] shape, Random rng){
        Nd4j.checkShapeValues(shape);
        INDArray res = Nd4j.create(shape);

        GaussianDistribution op1 = new GaussianDistribution(res, 0.0, 1.0 / Math.sqrt(shape[0]));
        Nd4j.getExecutioner().exec(op1, rng);
        return res;
    }
1125968
def shift( *offset )
      if offset.size != dimension
        raise "#{offset.size} offset(s) were given but array has " +
              "#{dimension} dimension(s)"
      end
      retval = Hornetseye::MultiArray(typecode, dimension).new *shape
      target, source, open, close = [], [], [], []
      ( shape.size - 1 ).step( 0, -1 ) do |i|
        callcc do |pass|
          delta = offset[i] % shape[i]
          source[i] = 0 ... shape[i] - delta
          target[i] = delta ... shape[i]
          callcc do |c|
            open[i] = c
            pass.call
          end
          source[i] = shape[i] - delta ... shape[i]
          target[i] = 0 ... delta
          callcc do |c|
            open[i] = c
            pass.call
          end
          close[i].call
        end
      end
      retval[ *target ] = self[ *source ] unless target.any? { |t| t.size == 0 }
      for i in 0 ... shape.size
        callcc do |c|
          close[i] = c
          open[i].call
        end
      end
      retval
    end
179282
public static Point getSize(byte[] byteArray, int offset, int length) {
        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = true;
        BitmapFactory.decodeByteArray(byteArray, offset, length, options);
        int width = options.outWidth;
        int height = options.outHeight;
        return new Point(width, height);
    }
820601
public static INDArray reshapeWeights(long[] shape, INDArray paramsView, char flatteningOrder) {
        return paramsView.reshape(flatteningOrder, shape);
    }
312081
public static Geometry createShape(String name, Mesh shape, ColorRGBA color) {
        checkInit();
        
        Geometry g = new Geometry(name, shape);
        Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.getAdditionalRenderState().setWireframe(true);
        mat.setColor("Color", color);
        g.setMaterial(mat);
        return g;
    }
232469
public static Geometry offsetCurve(Geometry geometry, double offset, String parameters) {
        if(geometry == null){
            return null;
        }
        String[] buffParemeters = parameters.split("\\s+");
        BufferParameters bufferParameters = new BufferParameters();
        for (String params : buffParemeters) {
            String[] keyValue = params.split("=");
            if (keyValue[0].equalsIgnoreCase("endcap")) {
                String param = keyValue[1];
                if (param.equalsIgnoreCase("round")) {
                    bufferParameters.setEndCapStyle(BufferParameters.CAP_ROUND);
                } else if (param.equalsIgnoreCase("flat") || param.equalsIgnoreCase("butt")) {
                    bufferParameters.setEndCapStyle(BufferParameters.CAP_FLAT);
                } else if (param.equalsIgnoreCase("square")) {
                    bufferParameters.setEndCapStyle(BufferParameters.CAP_SQUARE);
                } else {
                    throw new IllegalArgumentException("Supported join values are round, flat, butt or square.");
                }
            } else if (keyValue[0].equalsIgnoreCase("join")) {
                String param = keyValue[1];
                if (param.equalsIgnoreCase("bevel")) {
                    bufferParameters.setJoinStyle(BufferParameters.JOIN_BEVEL);
                } else if (param.equalsIgnoreCase("mitre") || param.equalsIgnoreCase("miter")) {
                    bufferParameters.setJoinStyle(BufferParameters.JOIN_MITRE);
                } else if (param.equalsIgnoreCase("round")) {
                    bufferParameters.setJoinStyle(BufferParameters.JOIN_ROUND);
                } else {
                    throw new IllegalArgumentException("Supported join values are bevel, mitre, miter or round.");
                }
            } else if (keyValue[0].equalsIgnoreCase("mitre_limit") || keyValue[0].equalsIgnoreCase("miter_limit")) {
                bufferParameters.setMitreLimit(Double.valueOf(keyValue[1]));
            } else if (keyValue[0].equalsIgnoreCase("quad_segs")) {
                bufferParameters.setQuadrantSegments(Integer.valueOf(keyValue[1]));
            } else {
                throw new IllegalArgumentException("Unknown parameters. Please read the documentation.");
            }
        }
        return computeOffsetCurve(geometry, offset, bufferParameters);
    }
525974
public static NDArrayDoubles readFromStream(InputStream stream) throws IOException {
    return readFromProto(NDArrayDoublesProto.NDArrayDoubles.parseFrom(stream));
  }