This method is for use by the developer to query the parser about
the possible paths that may be extracted.
@param maxDepth The maximum recursion depth
@return A list of all possible paths that could be determined automatically.
341550
public List<String> getPossiblePaths(int maxDepth) {
        if (allDissectors.isEmpty()) {
            return Collections.emptyList(); // nothing to do.
        }

        try {
            assembleDissectors();
        } catch (MissingDissectorsException | InvalidDissectorException e) {
            // Simply swallow this one
        }
        List<String> paths = new ArrayList<>();

        Map<String, List<String>> pathNodes = new HashMap<>();

        for (Dissector dissector : allDissectors) {
            final String inputType = dissector.getInputType();
            if (inputType == null) {
                LOG.error("Dissector returns null on getInputType(): [{}]", dissector.getClass().getCanonicalName());
                return Collections.emptyList();
            }

            final List<String> outputs = dissector.getPossibleOutput();

            if (LOG.isDebugEnabled()) {
                LOG.debug("------------------------------------");
                LOG.debug("Possible: Dissector IN {}", inputType);
                for (String output: outputs) {
                    LOG.debug("Possible:          --> {}", output);
                }
            }

            List<String> existingOutputs = pathNodes.get(inputType);
            if (existingOutputs != null) {
                outputs.addAll(existingOutputs);
            }
            pathNodes.put(inputType, outputs);
        }

        findAdditionalPossiblePaths(pathNodes, paths, "", rootType, maxDepth, "");

        for (Entry<String, Set<String>> typeRemappingSet: typeRemappings.entrySet()) {
            for (String typeRemapping: typeRemappingSet.getValue()) {

                String remappedPath = typeRemapping + ':' + typeRemappingSet.getKey();
                LOG.debug("Adding remapped path: {}", remappedPath);
                paths.add(remappedPath);
                findAdditionalPossiblePaths(pathNodes, paths, typeRemappingSet.getKey(), typeRemapping, maxDepth - 1, "");
            }
        }

        return paths;
    }
1048414
public static function nestedFolderIDs($parentID, $maxDepth = 5)
    {
        $ids = [$parentID];
        if ($maxDepth === 0) {
            return $ids;
        }
        $childIDs = Folder::get()->filter('ParentID', $parentID)->column('ID');
        foreach ($childIDs as $childID) {
            $ids = array_merge($ids, static::nestedFolderIDs($childID, $maxDepth - 1));
        }
        return $ids;
    }
1064012
function getDepths(depths, callback) {

    async.parallel([
        async.apply(store.getStore().getDepth.bind(store.getStore()), depths.parentUrl),
        async.apply(store.getStore().getDepth.bind(store.getStore()), depths.linkUri)
    ],
    function(error, results){
        if (error) {
          return callback(error);
        }
        depths.parentDepth = results[0];
        depths.linkDepth = results[1];
        callback(null, depths);
    });
}
1227474
protected int getDepth() {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getDepth");

    int depth;

    synchronized (barrier) {
       depth = queue.size();
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getDepth", depth);
    return depth;
  }
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;
}
193866
public static List<String> getDirectoryNames(String root, boolean fullPath) {
        List<File> fileList = getDirectoriesByName(root);
        List<String> list = new ArrayList<String>(fileList.size());

        for (File f : fileList) {
            String name = fullPath ? f.getAbsolutePath() : f.getName();
            list.add(name);
        }

        return list;
    }
73066
public static void collectSchemaXpathsForSimpleValues(
        CmsObject cms,
        CmsXmlContentDefinition def,
        String path,
        Set<String> result) {

        List<I_CmsXmlSchemaType> nestedTypes = def.getTypeSequence();
        for (I_CmsXmlSchemaType nestedType : nestedTypes) {
            String subPath = path + "/" + nestedType.getName();
            if (nestedType instanceof CmsXmlNestedContentDefinition) {
                CmsXmlContentDefinition nestedDef = ((CmsXmlNestedContentDefinition)nestedType).getNestedContentDefinition();
                collectSchemaXpathsForSimpleValues(cms, nestedDef, subPath, result);
            } else {
                result.add(subPath);
            }
        }
    }
1292511
public double getMaxDepth(@NonNull POS partOfSpeech) {
        if (maxDepths[partOfSpeech.ordinal()] == -1) {
            synchronized (maxDepths) {
                if (maxDepths[partOfSpeech.ordinal()] == -1) {
                    double max = 0d;
                    for (Synset synset : getSynsets()) {
                        if (synset.getPOS() == partOfSpeech) {
                            max = Math.max(max, synset.depth() - 1);
                        }
                    }
                    maxDepths[partOfSpeech.ordinal()] = max;
                }
            }
        }
        return maxDepths[partOfSpeech.ordinal()];
    }
234310
def dfs_paths(path)
      paths = []
      stack = [path]
      seen  = Set.new

      while path = stack.pop
        seen.add(path.last)
        paths << path

        children = yield path.last
        children.reverse_each do |node|
          stack.push(path + [node]) unless seen.include?(node)
        end
      end

      paths
    end
180299
public Result<List<Long>> finalizeSlicedFindPath() {

        List<Long> path = new ArrayList<>(64);
        if (m_query.status.isFailed()) {
            // Reset query.
            m_query = new QueryData();
            return Result.failure(path);
        }

        if (m_query.startRef == m_query.endRef) {
            // Special case: the search starts and ends at same poly.
            path.add(m_query.startRef);
        } else {
            // Reverse the path.
            if (m_query.lastBestNode.id != m_query.endRef) {
                m_query.status = Status.PARTIAL_RESULT;
            }

            Node prev = null;
            Node node = m_query.lastBestNode;
            int prevRay = 0;
            do {
                Node next = m_nodePool.getNodeAtIdx(node.pidx);
                node.pidx = m_nodePool.getNodeIdx(prev);
                prev = node;
                int nextRay = node.flags & Node.DT_NODE_PARENT_DETACHED; // keep track of whether parent is not adjacent
                                                                         // (i.e. due to raycast shortcut)
                node.flags = (node.flags & ~Node.DT_NODE_PARENT_DETACHED) | prevRay; // and store it in the reversed
                                                                                     // path's node
                prevRay = nextRay;
                node = next;
            } while (node != null);

            // Store path
            node = prev;
            do {
                Node next = m_nodePool.getNodeAtIdx(node.pidx);
                if ((node.flags & Node.DT_NODE_PARENT_DETACHED) != 0) {
                    Result<RaycastHit> iresult = raycast(node.id, node.pos, next.pos, m_query.filter, 0, 0);
                    if (iresult.succeeded()) {
                        path.addAll(iresult.result.path);
                    }
                    // raycast ends on poly boundary and the path might include the next poly boundary.
                    if (path.get(path.size() - 1) == next.id) {
                        path.remove(path.size() - 1); // remove to avoid duplicates
                    }
                } else {
                    path.add(node.id);
                }

                node = next;
            } while (node != null);
        }

        Status status = m_query.status;
        // Reset query.
        m_query = new QueryData();

        return Result.of(status, path);
    }
1103081
public static List<TreePath> computeExpandedPaths(JTree tree)
    {
        List<TreePath> treePaths = new ArrayList<TreePath>();
        int rows = tree.getRowCount();
        for (int i = 0; i < rows; i++)
        {
            TreePath treePath = tree.getPathForRow(i);
            treePaths.add(treePath);
        }
        return treePaths;
    }
1323862
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
	public int getMaxLines (){
		if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
			return mInputView.getMaxLines();

		return -1;
	}
188906
private Node makeNode(Random rng, int maxDepth)
    {
        if (functionProbability.nextEvent(rng) && maxDepth > 1)
        {
            // Max depth for sub-trees is one less than max depth for this node.
            int depth = maxDepth - 1;
            switch (rng.nextInt(5))
            {
                case 0: return new Addition(makeNode(rng, depth), makeNode(rng, depth));
                case 1: return new Subtraction(makeNode(rng, depth), makeNode(rng, depth));
                case 2: return new Multiplication(makeNode(rng, depth), makeNode(rng, depth));
                case 3: return new IfThenElse(makeNode(rng, depth), makeNode(rng, depth), makeNode(rng, depth));
                default: return new IsGreater(makeNode(rng, depth), makeNode(rng, depth));
            }
        }
        else if (parameterProbability.nextEvent(rng))
        {
            return new Parameter(rng.nextInt(parameterCount));
        }
        else
        {
            return new Constant(rng.nextInt(11));
        }
    }
591587
public static List<Path> getSubDirectoryPathList(Path startDirectoryPath,
			Predicate<Path> filter) {
		return getSubPathList(startDirectoryPath, Integer.MAX_VALUE,
				DirectoryAndNotSymbolicLinkFilter.and(filter));
	}
1109346
public static List<File> pathsFiles(final String paths, final Predicate<File> predicate) {
        final List<File> files = new ArrayList<File>();
        for (final String filePathAndName : paths.split(File.pathSeparator)) {
            final File file = new File(filePathAndName);
            if (file.isDirectory()) {
                try (final Stream<Path> stream = Files.walk(file.toPath(), Integer.MAX_VALUE)) {
                    stream.map(f -> f.toFile()).filter(predicate).forEach(files::add);
                } catch (final IOException ex) {
                    throw new RuntimeException("Error walking path: " + file, ex);
                }
            } else {
                if (predicate.test(file)) {
                    files.add(file);
                }
            }
        }
        return files;
    }
274379
static List<String> pathParts(String path) {
        String[] pathParts = path.split("/");
        List<String> parts = new ArrayList<>(pathParts.length);
        String pathSoFar = "";
        for (String pathPart : pathParts) {
            if (!pathPart.equals("")) {
                pathSoFar += "/" + pathPart;
                parts.add(pathSoFar);
            }
        }
        return parts;
    }
368787
public function handleMaxDepth(array &$context, $defaultMaxDepth = 10)
    {
        if (!array_key_exists(static::DEPTH_KEY, $context)) {
            $context[static::DEPTH_KEY] = 0;
        }
        $context[static::DEPTH_KEY]++;
        if (!array_key_exists(static::MAX_DEPTH_KEY, $context)) {
            $context[static::MAX_DEPTH_KEY] = $defaultMaxDepth;
        }
        if ($context[static::DEPTH_KEY] > $context[static::MAX_DEPTH_KEY]) {
            throw new RuntimeException('Max depth reached');
        }
    }