Returns an array of approximately `n` `shapely.geometry.MultiPolygon` objects for an array of
    `shapely.geometry.Point` objects.
502922
def gaussian_multi_polygons(points, n=10):
    
    polygons = gaussian_polygons(points, n*2)
    # Randomly stitch them together.
    polygon_pairs = [shapely.geometry.MultiPolygon(list(pair)) for pair in np.array_split(polygons.values, n)]
    return gpd.GeoSeries(polygon_pairs)
126191
function(points, bbox) {
        var result = [];
        for (var i = 0; i < points.length; i++) {
            var point = points[i];
            if (this.bboxContainsPoint(point, bbox)) {
                result.push(point);
            }
        }
        return result;
    }
1323159
def example_point(self):
        
        return np.array([([self.n_meas] + [0] * (self.n_elements-1),)], dtype=self.dtype)
99191
def n_forking_points(neurites, neurite_type=NeuriteType.all):
    ''''''
    return n_sections(neurites, neurite_type=neurite_type, iterator_type=Tree.iforking_point)
29406
function coordArrayToPoints(array, dimensions) {
                if (array.length % dimensions !== 0) {
                    throw new RangeError('Dimensions number must be accordance with the size of the array.');
                }

                var length = array.length / dimensions;
                var pointsArr = new Array(length);

                var k = 0;
                for (var i = 0; i < array.length; i += dimensions) {
                    var point = new Array(dimensions);
                    for (var j = 0; j < dimensions; ++j) {
                        point[j] = array[i + j];
                    }

                    pointsArr[k] = point;
                    k++;
                }

                return pointsArr;
            }
771516
def xywh_from_points(points):
    
    xys = [[int(p) for p in pair.split(',')] for pair in points.split(' ')]
    minx = sys.maxsize
    miny = sys.maxsize
    maxx = 0
    maxy = 0
    for xy in xys:
        if xy[0] < minx:
            minx = xy[0]
        if xy[0] > maxx:
            maxx = xy[0]
        if xy[1] < miny:
            miny = xy[1]
        if xy[1] > maxy:
            maxy = xy[1]

    return {
        'x': minx,
        'y': miny,
        'w': maxx - minx,
        'h': maxy - miny,
    }
1032155
private Collection<Geometry> unionAdjacentPolygons(Collection<Geometry> list) {
        UnaryUnionOp op = new UnaryUnionOp(list);
        Geometry result = op.union();
        if (result.getNumGeometries() < list.size()) {
            list.clear();
            for (int i = 0; i < result.getNumGeometries(); i++) {
                list.add(result.getGeometryN(i));
            }
        }
        return list;
    }
647646
def points(self):
        ''''''
        if self._points is None:
            _points = self.soma.points.tolist()
            for n in self.neurites:
                _points.extend(n.points.tolist())
            self._points = np.array(_points)

        return self._points
769871
def toVerticesAndPolygons(self):
        
        offset = 1.234567890
        verts = []
        polys = []
        vertexIndexMap = {}
        count = 0
        for poly in self.polygons:
            verts = poly.vertices
            cell = []
            for v in poly.vertices:
                p = v.pos
                # use string key to remove degeneracy associated
                # very close points. The format %.10e ensures that
                # points differing in the 11 digits and higher are 
                # treated as the same. For instance 1.2e-10 and 
                # 1.3e-10 are essentially the same.
                vKey = '%.10e,%.10e,%.10e' % (p[0] + offset, 
                                              p[1] + offset, 
                                              p[2] + offset)
                if not vKey in vertexIndexMap:
                    vertexIndexMap[vKey] = len(vertexIndexMap)
                index = vertexIndexMap[vKey]
                cell.append(index)
                count += 1
            polys.append(cell)
        # sort by index
        sortedVertexIndex = sorted(vertexIndexMap.items(),
                                   key=operator.itemgetter(1))
        verts = []
        for v, i in sortedVertexIndex:
            p = []
            for c in v.split(','):
                p.append(float(c) - offset)
            verts.append(tuple(p))
        return verts, polys, count
1177195
public static MultiPoint of(Stream<Point> points) {
        return of(points.collect(Collectors.toList()));
    }
1028790
private double[][] getPoints(Geometry input) {
        double[][] result = new double[input.getNumPoints()][];
        for (int i = 0; i < input.getPoints().size(); i++) {
            Point p = input.getPointN(i);
            if(p.isMeasured() && p.is3D()) {
                result[i] = new double[]{p.getX(), p.getY(), p.getZ(), p.getM()};
            } else if(p.isMeasured()) {
                // ideally we'd use something like Double.Nan, but JSON doesn't support that.
                result[i] = new double[]{p.getX(), p.getY(), 0, p.getM()};
            } else if(p.is3D()) {
                result[i] = new double[]{p.getX(), p.getY(), p.getZ()};
            } else {
                result[i] = new double[]{p.getX(), p.getY()};
            }
        }
        return result;
    }
399906
def gaussian_points(loc=(0, 0), scale=(10, 10), n=100):
    

    arr = np.random.normal(loc, scale, (n, 2))
    return gpd.GeoSeries([shapely.geometry.Point(x, y) for (x, y) in arr])
426409
public MultiPolygonOptions toPolygons(MultiPolygon multiPolygon) {

        MultiPolygonOptions polygons = new MultiPolygonOptions();

        for (Polygon polygon : multiPolygon.getPolygons()) {
            PolygonOptions polygonOptions = toPolygon(polygon);
            polygons.add(polygonOptions);
        }

        return polygons;
    }
126524
function(coords) {
        var tolerance = this.options.tolerance || 0.8;
        var enableHighQuality = !!this.options.highQuality;
        var points = GeometryUtils.simplify(coords, tolerance,
                enableHighQuality);
        return points;
    }
1080417
public OGCPoint pointN(int n) {
		int nn;
		if (multiPath.isClosedPath(0) && n == multiPath.getPathSize(0)) {
			nn = multiPath.getPathStart(0);
		} else
			nn = n + multiPath.getPathStart(0);

		return (OGCPoint) OGCGeometry.createFromEsriGeometry(
				multiPath.getPoint(nn), esriSR);
	}
1120150
@NonNull
  private static List<Point> coordAll(@NonNull List<Point> coords, @NonNull MultiPoint multiPoint) {
    coords.addAll(multiPoint.coordinates());
    return coords;
  }
140104
private static void getPunctualGeometry(ArrayList<Point> points, Geometry geometry) {
         for (int i = 0; i < geometry.getNumGeometries(); i++) {
            Geometry subGeom = geometry.getGeometryN(i);
            if(subGeom instanceof Point){
                points.add((Point) subGeom);
            }
            else if (subGeom instanceof GeometryCollection){
                getPunctualGeometry(points, subGeom);
            }
        }
    }