Returns specified range of sub-components in path joined together.

@see java.nio.file.Path#subpath(int, int)
495663
public UnixPath subpath(int beginIndex, int endIndex) {
    if (path.isEmpty() && beginIndex == 0 && endIndex == 1) {
      return this;
    }
    checkArgument(beginIndex >= 0 && endIndex > beginIndex);
    List<String> subList;
    try {
      subList = getParts().subList(beginIndex, endIndex);
    } catch (IndexOutOfBoundsException e) {
      throw new IllegalArgumentException();
    }
    return new UnixPath(permitEmptyComponents, JOINER.join(subList));
  }
658163
public static String get(String subPath) {
        String dataStr = null;
        try {
            dataStr = loadingCache.get(subPath).snd;
        } catch (ExecutionException e) {
            LOG.error(e);
        }
        return dataStr;
    }
805211
protected static String getRemainingPath(List<String> tokens, int i, int end) {
        if (tokens == null) {
            throw MESSAGES.nullArgument("tokens");
        }
        if (i < 0 || i >= end) { throw new IllegalArgumentException("i is not in the range of tokens: 0-" + (end - 1)); }
        if (i == end - 1) { return tokens.get(end - 1); }
        StringBuilder buffer = new StringBuilder();
        for (; i < end - 1; ++i) {
            buffer.append(tokens.get(i));
            buffer.append("/");
        }
        buffer.append(tokens.get(end - 1));
        return buffer.toString();
    }
1093288
def get_subpath(self, subpath: str):
        """"""
        for d in self._path:
            if os.path.exists(os.path.join(d, subpath)):
                return os.path.join(d, subpath)
        raise FileNotFoundError
383236
def split_path(path):
    
    path = path.split(0, 1)[0]
    values = path.dimension_values(0)
    splits = np.concatenate([[0], np.where(np.isnan(values))[0]+1, [None]])
    subpaths = []
    data = PandasInterface.as_dframe(path) if pd else path.array()
    for i in range(len(splits)-1):
        end = splits[i+1]
        slc = slice(splits[i], None if end is None else end-1)
        subpath = data.iloc[slc] if pd else data[slc]
        if len(subpath):
            subpaths.append(subpath)
    return subpaths
662803
public synchronized com.sun.tools.javac.util.List<String> getFiles(RelativeDirectory path) {
        try {
            checkIndex();

            DirectoryEntry de = directories.get(path);
            com.sun.tools.javac.util.List<String> ret = de == null ? null : de.getFiles();

            if (ret == null) {
                return com.sun.tools.javac.util.List.<String>nil();
            }
            return ret;
        }
        catch (IOException e) {
            return com.sun.tools.javac.util.List.<String>nil();
        }
    }
1089186
public VersionRange range(final int... parts) {
    checkNotNull(parts);
    checkArgument(parts.length != 0);

    StringBuilder buff = new StringBuilder()
        .append("[");

    for (int i = 0; i < parts.length; i++) {
      buff.append(parts[i]);
      if (i + 1 < parts.length) {
        buff.append(".");
      }
    }

    buff.append(",");

    for (int i = 0; i < parts.length; i++) {
      if (i + 1 == parts.length) {
        buff.append(parts[i] + 1);
      }
      else {
        buff.append(parts[i])
            .append(".");
      }
    }

    buff.append(")");

    log.trace("Range pattern: {}", buff);

    return parseRange(buff.toString());
  }
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;
	}
922098
public static boolean isSubPath(File parent, File child) throws IOException {
    String childStr = child.getCanonicalPath();
    String parentStr = parent.getCanonicalPath();

    return childStr.startsWith(parentStr);
  }
892708
def path_components(path):
    """"""

    def yield_components(path):
        # Iterate over each character and the next character
        chars = zip_longest(path, path[1:])
        try:
            # Iterate over components
            while True:
                c, n = next(chars)
                if c != '/':
                    raise ValueError("Invalid path, expected \"/\"")
                elif (n is not None and n != "'"):
                    raise ValueError("Invalid path, expected \"'\"")
                else:
                    # Consume "'" or raise StopIteration if at the end
                    next(chars)
                component = []
                # Iterate over characters in component name
                while True:
                    c, n = next(chars)
                    if c == "'" and n == "'":
                        component += "'"
                        # Consume second "'"
                        next(chars)
                    elif c == "'":
                        yield "".join(component)
                        break
                    else:
                        component += c
        except StopIteration:
            return

    return list(yield_components(path))
772247
@Override
    public Path subpath(final int beginIndex, final int endIndex) {
        if (beginIndex < 0) {
            throw new IllegalArgumentException("Begin index must be greater than 0");
        }
        if (endIndex < 0) {
            throw new IllegalArgumentException("End index must be greater than 0");
        }
        if (endIndex <= beginIndex) {
            throw new IllegalArgumentException("End index must be greater than begin index");
        }
        final List<String> tokens = tokenize(this);
        final int tokenCount = tokens.size();
        if (beginIndex >= tokenCount) {
            throw new IllegalArgumentException("Invalid begin index " + endIndex + " for " + this.toString()
                + "; must be between 0 and " + tokenCount + " exclusive");
        }
        if (endIndex > tokenCount) {
            throw new IllegalArgumentException("Invalid end index " + endIndex + " for " + this.toString()
                + "; must be between 0 and " + tokenCount + " inclusive");
        }
        final StringBuilder newPathBuilder = new StringBuilder();
        for (int i = 0; i < endIndex; i++) {
            newPathBuilder.append(ArchivePath.SEPARATOR);
            newPathBuilder.append(tokens.get(i));
        }
        final Path newPath = this.fromString(newPathBuilder.toString());
        return newPath;
    }
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;
    }
847223
@SuppressWarnings("unchecked")
    public <A extends Number & Comparable<?>> NumberPath<A> get(NumberPath<A> path) {
        NumberPath<A> newPath = getNumber(toString(path), (Class<A>) path.getType());
        return addMetadataOf(newPath, path);
    }
913958
public boolean isSubPath(String[] otherPath) {
        if (path == null || otherPath == null)
            return false;

        if (path.length >= otherPath.length)
            return false;

        for (int i = 0; i < path.length; i++) {
            int result = path[i].compareTo(otherPath[i]);
            if (result != 0)
                return false;
        }

        return true;
    }
1230859
private Path relativePath(final Path path) {
		List<Path> pathList = new ArrayList<>();
		for (Path part : path) {
			pathList.add(part);
		}

		int loadPathSize = this.loadPathParts.length;

		// loadPathのフォルダの並びと一致する場所を特定し、その下を相対パスとして返却する
		for (int i = 0; i < pathList.size() - loadPathSize; i++) {
			String[] paths = pathList.subList(i, i + loadPathSize).stream().map(Path::toString)
					.collect(Collectors.toList()).toArray(new String[loadPathSize]);
			if (Arrays.equals(this.loadPathParts, paths)) {
				return path.subpath(i + loadPathSize, path.getNameCount());
			}
		}
		// loadPathと一致しなかった場合は元のpathを返却する
		return path;
	}
141942
def _JoinKeyPath(self, path_segments):
    
    # This is an optimized way to combine the path segments into a single path
    # and combine multiple successive path separators to one.

    # Split all the path segments based on the path (segment) separator.
    path_segments = [
        segment.split(definitions.KEY_PATH_SEPARATOR)
        for segment in path_segments]

    # Flatten the sublists into one list.
    path_segments = [
        element for sublist in path_segments for element in sublist]

    # Remove empty path segments.
    path_segments = filter(None, path_segments)

    return definitions.KEY_PATH_SEPARATOR.join(path_segments)
1124340
@Pure
	public RoadPath getPathForRoadSegmentAt(int index) {
		if (index >= 0) {
			int b = 0;
			for (final RoadPath p : this.paths) {
				final int e = b + p.size();
				if (index < e) {
					return p;
				}
				b = e;
			}
		}
		throw new IndexOutOfBoundsException();
	}