Calculates the length of coordinates in a shapely geometry.
176292
def geom_length(geom):
    
    if geom.geom_type == 'Point':
        return 1
    if hasattr(geom, 'exterior'):
        geom = geom.exterior
    if not geom.geom_type.startswith('Multi') and hasattr(geom, 'array_interface_base'):
        return len(geom.array_interface_base['data'])//2
    else:
        length = 0
        for g in geom:
            length += geom_length(g)
        return length
901376
def __shpFileLength(self):
        """"""
        # Remember starting position
        start = self.shp.tell()
        # Calculate size of all shapes
        self.shp.seek(0,2)
        size = self.shp.tell()
        # Calculate size as 16-bit words
        size //= 2
        # Return to start
        self.shp.seek(start)
        return size
196608
def length(self):
        """"""
        return math.sqrt((self.x * self.x) + (self.y * self.y) + (self.z * self.z) + (self.w * self.w))
414762
def _get_geometry(self):
        
        return shapely.geometry.MultiPolygon([bbox.geometry for bbox in self.bbox_list])
30378
function sizeofSimple(glyf, glyfSupport, hinting) {

            if (!glyf.contours || 0 === glyf.contours.length) {
                return 0;
            }

            // fixed header + endPtsOfContours
            var result = 12
                + glyf.contours.length * 2
                + glyfSupport.flags.length;

            glyfSupport.xCoord.forEach(function (x) {
                result += 0 <= x && x <= 0xFF ? 1 : 2;
            });

            glyfSupport.yCoord.forEach(function (y) {
                result += 0 <= y && y <= 0xFF ? 1 : 2;
            });

            return result + (hinting && glyf.instructions ? glyf.instructions.length : 0);
        }
913005
function polygonClosed(coordinates) {
  var a = coordinates[0],
      b = coordinates[coordinates.length - 1];
  return !(a[0] - b[0] || a[1] - b[1]);
}
47150
public static double length3D(Geometry geom) {
                double sum = 0;
                for (int i = 0; i < geom.getNumGeometries(); i++) {
                        Geometry subGeom = geom.getGeometryN(i);
                        if (subGeom instanceof Polygon) {
                                sum += length3D((Polygon) subGeom);
                        } else if (subGeom instanceof LineString) {
                                sum += length3D((LineString) subGeom);
                        }
                }
                return sum;
        }
31654
public static double getLength(Geometry geometry) {
		double length = 0;
		if (geometry.getGeometries() != null) {
			for (Geometry child : geometry.getGeometries()) {
				length += getLength(child);
			}
		}
		if (geometry.getCoordinates() != null
				&& (Geometry.LINE_STRING.equals(geometry.getGeometryType()) || Geometry.LINEAR_RING.equals(geometry
						.getGeometryType()))) {
			for (int i = 0; i < geometry.getCoordinates().length - 1; i++) {
				double deltaX = geometry.getCoordinates()[i + 1].getX() - geometry.getCoordinates()[i].getX();
				double deltaY = geometry.getCoordinates()[i + 1].getY() - geometry.getCoordinates()[i].getY();
				length += Math.sqrt(deltaX * deltaX + deltaY * deltaY);
			}
		}
		return length;
	}
443602
def length(self, vertices):
        
        length = ((np.diff(self.discrete(vertices),
                           axis=0)**2).sum(axis=1)**.5).sum()
        return length
75439
def length(self):
        """"""
        return sum([shot.length for shot in self.shots if not shot.is_splay])
378390
function calculateBoundsForGeometryCollection(geometryCollection){
    var extents = [], extent;

    for (var i = geometryCollection.geometries.length - 1; i >= 0; i--) {
      extent = calculateBounds(geometryCollection.geometries[i]);
      extents.push([extent[0],extent[1]]);
      extents.push([extent[2],extent[3]]);
    }

    return calculateBoundsFromArray(extents);
  }
767268
def ilength(self, s, s_tol=ILENGTH_S_TOL, maxits=ILENGTH_MAXITS,
                error=ILENGTH_ERROR, min_depth=ILENGTH_MIN_DEPTH):
        """"""
        return inv_arclength(self, s, s_tol=s_tol, maxits=maxits, error=error,
                             min_depth=min_depth)
1139667
def waveform_length(X):
    '''  '''
    return np.sum(np.abs(np.diff(X, axis=1)), axis=1)
388897
def length(self):
        """"""
        return math.sqrt((self.X * self.X) + (self.Y * self.Y))
155420
def p_length(self, p):
        ''
        p[0] = Length(p[2], p[4], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
195224
def shape(self, i=0):
        """"""
        shp = self.__getFileObj(self.shp)
        i = self.__restrictIndex(i)
        offset = self.__shapeIndex(i)
        if not offset:
            # Shx index not available so use the full list.
            shapes = self.shapes()
            return shapes[i]
        shp.seek(offset)
        return self.__shape()
177476
def calculate_dimensions(image, long_side, short_side):
    """"""
    if image.width >= image.height:
        return '{0}x{1}'.format(long_side, short_side)
    return '{0}x{1}'.format(short_side, long_side)