Convert a path of vertices to a binary vector of edges. It is possible to
convert the vector back to the path using {@see #edge}.

@param path the vertices which define the cycle
@return vector edges which make up the path
@see #indexOfEdge(int, int)
501723
BitSet toEdgeVector(final int[] path) {
        final BitSet incidence = new BitSet(edges.size());
        int len = path.length - 1;
        for (int i = 0; i < len; i++) {
            incidence.set(indexOfEdge(path[i], path[i + 1]));
        }
        return incidence;
    }
1249173
def paths2edges(paths):
    
    edges_all = set()
    for path in paths:
        for edge in path2edges(path):
            edges_all.add(edge)
    return edges_all
765801
public VirtualFile getChild(String path) {
        if (path == null) {
            throw VFSMessages.MESSAGES.nullArgument("path");
        }
        final List<String> pathParts = PathTokenizer.getTokens(path);
        VirtualFile current = this;
        for (String part : pathParts) {
            if (PathTokenizer.isReverseToken(part)) {
                final VirtualFile parent = current.parent;
                current = parent == null ? current : parent;
            } else if (PathTokenizer.isCurrentToken(part) == false) {
                current = new VirtualFile(part, current);
            }
        }
        return current;
    }
345559
public static List<ChildNumber> parsePath(@Nonnull String path) {
        String[] parsedNodes = path.replace("M", "").split("/");
        List<ChildNumber> nodes = new ArrayList<>();

        for (String n : parsedNodes) {
            n = n.replaceAll(" ", "");
            if (n.length() == 0) continue;
            boolean isHard = n.endsWith("H");
            if (isHard) n = n.substring(0, n.length() - 1);
            int nodeNumber = Integer.parseInt(n);
            nodes.add(new ChildNumber(nodeNumber, isHard));
        }

        return nodes;
    }
377601
public <K> Graph<K, NullValue, NullValue> keyType(Class<K> vertexKey) {

		if (edgeReader == null) {
			throw new RuntimeException("The edge input file cannot be null!");
		}

		DataSet<Edge<K, NullValue>> edges = edgeReader
			.types(vertexKey, vertexKey)
				.name(GraphCsvReader.class.getName())
			.map(new Tuple2ToEdgeMap<>())
				.name("Type conversion");

		return Graph.fromDataSet(edges, executionContext);
	}
1146996
public BufferedImage buildBufferedImageOfIconInOS(Path path) {
		path = JMOptional
				.getNullableAndFilteredOptional(path, JMPath.NotExistFilter)
				.flatMap(JMPathOperation::createTempFilePathAsOpt).orElse(path);
		Icon iconInOS = os.getIcon(path.toFile());
		BufferedImage bufferedImage = new BufferedImage(iconInOS.getIconWidth(),
				iconInOS.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
		iconInOS.paintIcon(null, bufferedImage.getGraphics(), 0, 0);
		return bufferedImage;
	}
467124
public static List<String> getTokens(String path) {
        if (path == null) {
            throw MESSAGES.nullArgument("path");
        }
        List<String> list = new ArrayList<String>();
        getTokens(list, path);
        return list;
    }
1187202
@SuppressWarnings("unchecked")
    @Override
    public XBAutoList<T> getList(final CharSequence path) {
        return (XBAutoList<T>) getList(path, invocationContext.getTargetComponentType());
    }
1086173
@Pure
	public final void toPath2D(Path2d path) {
		// loop on parts and build the path to draw
		boolean firstPoint;
		for (final PointGroup grp : groups()) {
			firstPoint = true;
			for (final Point2d pts : grp) {
				final double x = pts.getX();
				final double y = pts.getY();
				if (firstPoint) {
					path.moveTo(x, y);
					firstPoint = false;
				} else {
					path.lineTo(x, y);
				}
			}
		}
	}
472436
protected int transition(char[] path)
    {
        int b = base[0];
        int p;

        for (int i = 0; i < path.length; ++i)
        {
            p = b + (int) (path[i]) + 1;
            if (b == check[p])
                b = base[p];
            else
                return -1;
        }

        p = b;
        return p;
    }
108139
String withPath(String[] path) {
        StringBuilder sb = new StringBuilder();
        if (path.length > 0) {
            sb.append(" (with path ");
            for (int i = 0; i < path.length - 1; i++) {
                sb.append(path[i]);
                sb.append(".");
            }
            sb.append(path[path.length - 1]);
            sb.append(") ");
        }
        return sb.toString();

    }
997861
def _svg_path_convert(paths):
    
    def complex_to_float(values):
        return np.array([[i.real, i.imag] for i in values])

    def load_line(svg_line):
        points = complex_to_float([svg_line.point(0.0),
                                   svg_line.point(1.0)])
        if starting:
            # return every vertex and use it
            return (entities_mod.Line(np.arange(2) + len(vertices)), points)
        else:
            # we are not starting so use the last referenced vertex as the
            # start point
            return (entities_mod.Line(
                np.arange(2) + len(vertices) - 1), points[1:])

    def load_arc(svg_arc):
        points = complex_to_float([svg_arc.start,
                                   svg_arc.point(.5),
                                   svg_arc.end])
        if starting:
            # return every vertex and use it
            return (entities_mod.Arc(np.arange(3) + len(vertices)), points)
        else:
            # we are not starting so use the last referenced vertex as the
            # start point
            return (entities_mod.Arc(np.arange(3) +
                                     len(vertices) - 1), points[1:])

    def load_quadratic(svg_quadratic):
        points = complex_to_float([svg_quadratic.start,
                                   svg_quadratic.control,
                                   svg_quadratic.end])
        if starting:
            # return every vertex and use it
            return (entities_mod.Bezier(np.arange(3) + len(vertices)), points)
        else:
            # we are not starting so use the last referenced vertex as the
            # start point
            return (entities_mod.Bezier(
                np.arange(3) + len(vertices) - 1), points[1:])

    def load_cubic(svg_cubic):
        points = complex_to_float([svg_cubic.start,
                                   svg_cubic.control1,
                                   svg_cubic.control2,
                                   svg_cubic.end])
        if starting:
            # return every vertex and use it
            return (entities_mod.Bezier(np.arange(4) + len(vertices)), points)
        else:
            # we are not starting so use the last referenced vertex as the
            # start point
            return (entities_mod.Bezier(
                np.arange(4) + len(vertices) - 1), points[1:])

    # store loaded values here
    entities = []
    vertices = []
    loaders = {'Arc': load_arc,
               'Line': load_line,
               'CubicBezier': load_cubic,
               'QuadraticBezier': load_quadratic}

    for path_string, matrix in paths:
        starting = True
        for svg_entity in parse_path(path_string):
            type_name = svg_entity.__class__.__name__
            if type_name in loaders:
                e, v = loaders[type_name](svg_entity)
                entities.append(e)
                vertices.extend(transform_points(v, matrix))
    # store results as kwargs
    loaded = {'entities': np.array(entities),
              'vertices': np.array(vertices)}
    return loaded
378048
public static String parentPathString(String path) {
        String[] split = componentsFromPathString(path);
        if (split.length > 1) {
            StringBuilder stringBuilder = new StringBuilder();
            for (int i = 0; i < split.length - 1; i++) {
                if (i > 0) {
                    stringBuilder.append(SEPARATOR);
                }
                stringBuilder.append(split[i]);
            }
            return stringBuilder.toString();
        }
        return "";
    }
983430
B append(String path) {
    Preconditions.checkArgument(
        path != null && !path.isEmpty(), "'path' must be a non-empty String");
    ImmutableList.Builder<String> components = ImmutableList.builder();
    components.addAll(this.getSegments());
    components.add(splitChildPath(path));
    return createPathWithSegments(components.build());
  }
732811
public static ComputationGraph restoreComputationGraph(@NonNull String path) throws IOException {
        return restoreComputationGraph(new File(path), true);
    }
1184084
public OptionsBuilder path(String path) {
		options.put(Options.CHAIN_PATH, path != null ? path : DEFAULT_PATH);
		return this;
    }
118528
function SvgPath(path) {
  if (!(this instanceof SvgPath)) { return new SvgPath(path); }

  // Array of path segments.
  // Each segment is array [command, param1, param2, ...]
  try {
    this.segments = parse(path);
  } catch (e) {
    this.segments = [];
  }
}