Returns length of the path, with precision better than requested `opt.precision`; or using `opt.segmentSubdivisions` provided. If path has no segments, returns 0.
195731
function(opt) {

            var segments = this.segments;
            var numSegments = segments.length;
            if (numSegments === 0) return 0; // if segments is an empty array

            opt = opt || {};
            var precision = (opt.precision === undefined) ? this.PRECISION : opt.precision; // opt.precision only used in getSegmentSubdivisions() call
            var segmentSubdivisions = (opt.segmentSubdivisions === undefined) ? this.getSegmentSubdivisions({ precision: precision }) : opt.segmentSubdivisions;
            // not using localOpt

            var length = 0;
            for (var i = 0; i < numSegments; i++) {

                var segment = segments[i];
                var subdivisions = segmentSubdivisions[i];
                length += segment.length({ subdivisions: subdivisions });
            }

            return length;
        }
940669
public static int optionLength(String option) {
    int result = Standard.optionLength(option);
    if(result == 0) {
      if(option.equals(OPTION_PATH_UML_PROJECT)) {
        result = 2;
      }
    }
    return result;
  }
710811
public double pathLength(double delta, Point2D.Double... controlPoints)
    {
        if (controlPoints.length != length)
        {
            throw new IllegalArgumentException("control-points length not "+length);
        }
        double[] cp = convert(controlPoints);
        return pathLength(delta, cp);
    }
8890
private double penalizedPathDistance(Path path,
                                         Set<EdgeIteratorState> penalizedVirtualEdges) {
        double totalPenalty = 0;

        // Unfavored edges in the middle of the path should not be penalized because we are
        // only concerned about the direction at the start/end.
        final List<EdgeIteratorState> edges = path.calcEdges();
        if (!edges.isEmpty()) {
            if (penalizedVirtualEdges.contains(edges.get(0))) {
                totalPenalty += uTurnDistancePenalty;
            }
        }
        if (edges.size() > 1) {
            if (penalizedVirtualEdges.contains(edges.get(edges.size() - 1))) {
                totalPenalty += uTurnDistancePenalty;
            }
        }
        return path.getDistance() + totalPenalty;
    }
1311925
private int getLength()
    {
        if (m_length_ >= 0) {
            return m_length_;
        }
        int length = m_key_.length;
        for (int index = 0; index < length; index ++) {
            if (m_key_[index] == 0) {
                length = index;
                break;
            }
        }
        m_length_ = length;
        return m_length_;
    }
543863
function getPathDepth(p) {
  var parts = p.split(path.sep);
  // On *nix-based OS's, the root is '/'
  if(!parts[0]) {
    parts.unshift();
  }

  return p.split(path.sep).length;
}
514051
def get_file_size(self, path):
        
        id = self._get_id_for_path(path)
        blob = self.repository._repo[id]
        return blob.raw_length()
314445
def pathlen(self):
        """"""

        try:
            ext = self.x509.extensions.get_extension_for_oid(ExtensionOID.BASIC_CONSTRAINTS)
        except x509.ExtensionNotFound:  # pragma: no cover - extension should always be present
            return None
        return ext.value.path_length
638669
public static function computeLength($path) {
        if (count($path) < 2) {
            return 0;
        }
        $length = 0;
        $prev = $path[0];
        $prevLat = deg2rad($prev['lat']);
        $prevLng = deg2rad($prev['lng']);
        foreach($path as $point) {
            $lat = deg2rad($point['lat']);
            $lng = deg2rad($point['lng']);
            $length += self::distanceRadians($prevLat, $prevLng, $lat, $lng);
            $prevLat = $lat;
            $prevLng = $lng;
        }
        return $length * MathUtil::EARTH_RADIUS;
    }
270120
def extract_length(self, lower_bound=None, upper_bound=None, new_path=None):
        """"""
        # Temporary path #
        if new_path is None: fraction = self.__class__(new_temp_path())
        elif isinstance(new_path, FASTA): fraction = new_path
        else:                fraction = self.__class__(new_path)
        # Generator #
        if lower_bound is None: lower_bound = 0
        if upper_bound is None: upper_bound = sys.maxint
        def fraction_iterator():
            for read in self:
                if lower_bound <= len(read) <= upper_bound:
                    yield read
        # Do it #
        fraction.write(fraction_iterator())
        fraction.close()
        return fraction
1034790
function(path) {
    if (path.slice(-1) == '/') {
        path = path.substring(0, path.length - 1);
    }
    var lastSlash = path.lastIndexOf('/');
    return (lastSlash > 0) ? path.substring(0, lastSlash) : "";
}
1148377
function(t, opt) {

            if (t <= 0) return 0;

            opt = opt || {};
            var precision = (opt.precision === undefined) ? this.PRECISION : opt.precision;
            // not using opt.subdivisions
            // not using localOpt

            var subCurve = this.divide(t)[0];
            var subCurveLength = subCurve.length({ precision: precision });

            return subCurveLength;
        }
571102
@Pure
	public int indexOf(RoadSegment segment) {
		int count = 0;
		int index;
		for (final RoadPath p : this.paths) {
			index = p.indexOf(segment);
			if (index >= 0) {
				return count + index;
			}
			count += p.size();
		}
		return -1;
	}
926031
function(ratio, opt) {

            if (ratio <= 0) return 0;
            if (ratio >= 1) return 1;

            opt = opt || {};
            var precision = (opt.precision === undefined) ? this.PRECISION : opt.precision;
            var subdivisions = (opt.subdivisions === undefined) ? this.getSubdivisions({ precision: precision }) : opt.subdivisions;
            var localOpt = { precision: precision, subdivisions: subdivisions };

            var curveLength = this.length(localOpt);
            var length = curveLength * ratio;

            return this.tAtLength(length, localOpt);
        }
802823
public double pathLengthEstimate(Point2D.Double... controlPoints)
    {
        if (controlPoints.length != length)
        {
            throw new IllegalArgumentException("control-points length not "+length);
        }
        double[] cp = convert(controlPoints);
        return pathLengthEstimate(cp);
    }
1293685
def length(self):
        
        if isinstance(self._value, int):
            return byte_len(self._value)
        if self._value is None:
            return 0
        return len(self._value)
151168
private int getMaxHeight() {
        int result = 0;
        for (int i = 0; i < segmentCount; i++) {
            result = Math.max(result, segmentHeight(i, false));
        }
        return result;
    }