Returns the bbox of the path. If path has no segments, returns null. If path has only invisible segments, returns bbox of the end point of last segment.
324513
function() {

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

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

                var segment = segments[i];
                if (segment.isVisible) {
                    var segmentBBox = segment.bbox();
                    bbox = bbox ? bbox.union(segmentBBox) : segmentBBox;
                }
            }

            if (bbox) return bbox;

            // if the path has only invisible elements, return end point of last segment
            var lastSegment = segments[numSegments - 1];
            return new Rect(lastSegment.end.x, lastSegment.end.y, 0, 0);
        }
498130
def get_bboxes_pathcollection(sc, ax):
    """"""
#    ax.figure.canvas.draw() # need to draw before the transforms are set.
    transform = sc.get_transform()
    transOffset = sc.get_offset_transform()
    offsets = sc._offsets
    paths = sc.get_paths()
    transforms = sc.get_transforms()

    if not transform.is_affine:
        paths = [transform.transform_path_non_affine(p) for p in paths]
        transform = transform.get_affine()
    if not transOffset.is_affine:
        offsets = transOffset.transform_non_affine(offsets)
        transOffset = transOffset.get_affine()

    if isinstance(offsets, np.ma.MaskedArray):
        offsets = offsets.filled(np.nan)

    bboxes = []

    if len(paths) and len(offsets):
        if len(paths) < len(offsets):
            # for usual scatters you have one path, but several offsets
            paths = [paths[0]]*len(offsets)
        if len(transforms) < len(offsets):
            # often you may have a single scatter size, but several offsets
            transforms = [transforms[0]]*len(offsets)

        for p, o, t in zip(paths, offsets, transforms):
            result = get_path_collection_extents(
                transform.frozen(), [p], [t],
                [o], transOffset.frozen())
            bboxes.append(result.inverse_transformed(ax.transData))

    return bboxes
515126
public Integer getEnd() {
    if (mtasPositionType.equals(POSITION_RANGE)
        || mtasPositionType.equals(POSITION_SET)) {
      return mtasPositionEnd;
    } else if (mtasPositionType.equals(POSITION_SINGLE)) {
      return mtasPositionStart;
    } else {
      return null;
    }
  }
866154
@Pure
	public int lastIndexOf(RoadSegment segment) {
		int count = 0;
		int index;
		int lastIndex = -1;
		for (final RoadPath p : this.paths) {
			index = p.lastIndexOf(segment);
			if (index >= 0) {
				lastIndex = count + index;
			}
			count += p.size();
		}
		return lastIndex;
	}
656113
public Bbox getBounds() {
		if (isEmpty()) {
			return null;
		}
		double minX = Double.MAX_VALUE;
		double minY = Double.MAX_VALUE;
		double maxX = -Double.MAX_VALUE;
		double maxY = -Double.MAX_VALUE;

		for (Point point : points) {
			if (point.getX() < minX) {
				minX = point.getX();
			}
			if (point.getY() < minY) {
				minY = point.getY();
			}
			if (point.getX() > maxX) {
				maxX = point.getX();
			}
			if (point.getY() > maxY) {
				maxY = point.getY();
			}
		}

		return new Bbox(minX, minY, maxX - minX, maxY - minY);
	}
355956
public Bbox getBounds() {
		Bbox bounds = null;
		if (!isEmpty()) {
			for (Polygon polygon : polygons) {
				if (bounds == null) {
					bounds = polygon.getBounds();
				} else {
					bounds = bounds.union(polygon.getBounds());
				}
			}
		}
		return bounds;
	}
482818
function(index) {

            var segments = this.segments;
            var numSegments = segments.length;
            if (numSegments === 0) throw new Error('Path has no segments.');

            if (index < 0) index = numSegments + index; // convert negative indices to positive
            if (index >= numSegments || index < 0) throw new Error('Index out of range.');

            return segments[index];
        }
295271
@Override
  public PathImpl getParent()
  {
    if (_pathname.length() <= 1)
      return lookup("/");

    int length = _pathname.length();
    int lastSlash = _pathname.lastIndexOf('/');

    if (lastSlash < 1)
      return lookup("/");

    if (lastSlash == length - 1) {
      lastSlash = _pathname.lastIndexOf('/', length - 2);
      if (lastSlash < 1)
        return lookup("/");
    }

    return lookup(_pathname.substring(0, lastSlash));
  }
933344
function(path) {
      return path.lastIndexOf('.') != -1 ? 
        path.slice(path.lastIndexOf('.') + 1, path.length) :
          null
    }
506829
public int getPathCount() {
    int result = 0;
    for(IndexTreePath<E> path = this; path != null; path = path.parentPath) {
      result++;
    }
    return result;
  }
214099
private static LocationPath discardSelfNode(LocationPath path){
        int noOfNulls = 0;
        Step steps[] = path.steps;

        for(int i=steps.length-1; i>=0; --i){
            Step step = steps[i];
            if(step.axis==Axis.SELF && step.constraint.id==Constraint.ID_NODE && !step.predicateSet.hasPosition){
                if(step.predicateSet.getPredicate()==null){
                    steps[i] = null;
                    noOfNulls++;
                }else{
                    if(i!=0){
                        steps[i] = null;
                        steps[i-1].setPredicate(step);
                        noOfNulls++;
                    }
                }
            }
        }
        return noOfNulls>0 ? removeNullSteps(path, noOfNulls) : path;
    }
419368
private org.geomajas.geometry.Bbox toBbox(Bbox bounds) {
		return new org.geomajas.geometry.Bbox(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());
	}
931264
public static String getParentPath(final String path) {
    final int pos = path.lastIndexOf(File.separator);
    if (pos <= 0) {
      return null;
    }
    return path.substring(0, pos);
  }
369465
public JimfsPath emptyPath() {
    JimfsPath result = emptyPath;
    if (result == null) {
      // use createPathInternal to avoid recursive call from createPath()
      result = createPathInternal(null, ImmutableList.of(Name.EMPTY));
      emptyPath = result;
      return result;
    }
    return result;
  }
364664
function() {
      var path = this.decodeFragment(this.location.pathname);
      var rootPath = path.slice(0, this.root.length - 1) + '/';
      return rootPath === this.root;
    }
445789
function findHoleBridge(hole, outerNode) {
       var p = outerNode,
           hx = hole.x,
           hy = hole.y,
           qx = -Infinity,
           m;

       // find a segment intersected by a ray from the hole's leftmost point to the left;
       // segment's endpoint with lesser x will be potential connection point
       do {
           if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {
               var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);
               if (x <= hx && x > qx) {
                   qx = x;
                   if (x === hx) {
                       if (hy === p.y) return p;
                       if (hy === p.next.y) return p.next;
                   }
                   m = p.x < p.next.x ? p : p.next;
               }
           }
           p = p.next;
       } while (p !== outerNode);

       if (!m) return null;

       if (hx === qx) return m.prev; // hole touches outer segment; pick lower endpoint

       // look for points inside the triangle of hole point, segment intersection and endpoint;
       // if there are no points found, we have a valid connection;
       // otherwise choose the point of the minimum angle with the ray as connection point

       var stop = m,
           mx = m.x,
           my = m.y,
           tanMin = Infinity,
           tan;

       p = m.next;

       while (p !== stop) {
           if (hx >= p.x && p.x >= mx && hx !== p.x &&
                   pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {

               tan = Math.abs(hy - p.y) / (hx - p.x); // tangential

               if ((tan < tanMin || (tan === tanMin && p.x > m.x)) && locallyInside(p, hole)) {
                   m = p;
                   tanMin = tan;
               }
           }

           p = p.next;
       }

       return m;
   }
1266461
public static String getLastSegment(final List<PathSegment> segments) {
        if (segments.isEmpty()) {
            return "";
        }
        return segments.get(segments.size() - 1).getPath();
    }