To retrieve the node corresponding to a path specified as an array or string
 Do not mention the root.
 e.g. "ruby/1.9.2/io/console"
 or %w[ ruby 1.9.3 io console ]
 @since 1.4.0 2011-10-2
432353
def get_node_for_path(user_path)
      case user_path
      when String
        user_path = user_path.split "/"
      when Array
      else
        raise ArgumentError, "Should be Array or String delimited with /"
      end
      $log.debug "TREE #{user_path} " if $log.debug? 
      root = @treemodel.root
      found = nil
      user_path.each { |e| 
        success = false
        root.children.each { |c| 
          if c.user_object == e
            found = c
            success = true
            root = c
            break
          end
        }
        return false unless success

      }
      return found
    end
302998
private String getNodeString(String attribute, String... path)
    {
        final Xml node = getNode(path);
        return node.readString(attribute);
    }
94055
def visit_root(node)
      @enabled = matcher.match(File.basename(node.file)) ? true : false
    end
548932
static String canonicalizePath(String path) {
    String[] parts = path.split(MODULE_SLASH);
    String[] buffer = new String[parts.length];
    int position = 0;
    int available = 0;

    boolean absolutePath = (parts.length > 1 && parts[0].isEmpty());
    if (absolutePath) {
      // If the path starts with "/" (so the left side, index zero, is empty), then the path will
      // always remain absolute. Make the first segment unavailable to touch.
      --available;
    }

    for (String part : parts) {
      if (part.equals(".")) {
        continue;
      }

      if (part.equals("..")) {
        if (available > 0) {
          // Consume the previous segment.
          --position;
          --available;
          buffer[position] = null;
        } else if (!absolutePath) {
          // If this is a relative path, retain "..", as it can't be consumed on the left.
          buffer[position] = part;
          ++position;
        }
        continue;
      }

      buffer[position] = part;
      ++position;
      ++available;
    }

    if (absolutePath && position == 1) {
      return MODULE_SLASH;  // special-case single absolute segment as joining [""] doesn't work
    }
    return MODULE_JOINER.join(Arrays.copyOf(buffer, position));
  }
72780
private Node getNestedNode(ArchivePath path) {
        // Iterate through nested archives
        for (Entry<ArchivePath, ArchiveAsset> nestedArchiveEntry : nestedArchives.entrySet()) {
            ArchivePath archivePath = nestedArchiveEntry.getKey();
            ArchiveAsset archiveAsset = nestedArchiveEntry.getValue();

            // Check to see if the requested path starts with the nested archive path
            if (startsWith(path, archivePath)) {
                Archive<?> nestedArchive = archiveAsset.getArchive();

                // Get the asset path from within the nested archive
                ArchivePath nestedAssetPath = getNestedPath(path, archivePath);

                // Recurse the call to the nested archive
                return nestedArchive.get(nestedAssetPath);
            }
        }
        return null;
    }
841209
def parse_path(self, node):
        

        if 'name' in node.lattrib:
            name = node.lattrib['name']
        else:
            self.raise_error('<Path> must specify a name.')

        description = node.lattrib.get('description', '')

        self.current_component_type.add_path(Path(name, description))
798133
public static String getNodeFromPath(String path)
    {
        PathUtils.validatePath(path);
        int i = path.lastIndexOf(PATH_SEPARATOR);
        if ( i < 0 )
        {
            return path;
        }
        if ( (i + 1) >= path.length() )
        {
            return "";
        }
        return path.substring(i + 1);
    }
672849
function(root, path) {
				if (path.indexOf(this.SEPARATOR) === 0) {
					root = this.rootNode;
					path = path.substring(1);
				} else {
					if (!root) {
						if (!this.currentDirectory) {
							/* no node to resolve the path in terms of */
							return null;
						}
						root = this.currentDirectory;
					}
				}
				var segments = path.substring(0, path.lastIndexOf(this.SEPARATOR)).split(this.SEPARATOR);
				var result = root;
				for (var i = 0; i < segments.length; i++) {
					if (segments[i].length > 0) {
						result = this.getChild(result, segments[i]);
						if (!result || !result.Directory) {
							/* non-existent directory */
							return null;
						}
					}
				}

				/*
				 * If the full path represents a directory then initiate the
				 * retrieval of its full node info and children.
				 */
				var lastSegment = path.substring(path.lastIndexOf(this.SEPARATOR) + 1);
				var child = this.getChild(result, lastSegment);
				if (child) {
					this._retrieveNode(child);
				}

				if (!result.Children) {
					this._retrieveNode(result);
				}
				return result;
			}
1151127
def extract(*path)
      node = payload
      node if path.all? do |sub|
        break unless node.is_a? Hash

        node = node[sub.to_s]
      end
    end
969856
def get_node(self, key):
        """"""
        pos = self._get_node_pos(key)
        if pos is None:
            return None
        return self._hashring[self._sorted_keys[pos]]
365930
@Nullable
    private Node<V> findNode(Node<V> node, String path, int begin, boolean exact) {
        final int next;
        switch (node.type()) {
            case EXACT:
                final int len = node.path().length();
                if (!path.regionMatches(begin, node.path(), 0, len)) {
                    // A given path does not start with the path of this node.
                    return null;
                }
                if (len == path.length() - begin) {
                    // Matched. No more input characters.
                    // If this node is not added by a user, then we should return a catch-all child
                    // if it exists. But if 'exact' is true, we just return this node to make caller
                    // have the exact matched node.
                    return exact || node.hasValues() || !node.hasCatchAllChild() ? node
                                                                                 : node.catchAllChild();
                }
                next = begin + len;
                break;
            case PARAMETER:
                // Consume characters until the delimiter '/' as a path variable.
                final int delim = path.indexOf('/', begin);
                if (delim < 0) {
                    // No more delimiter.
                    return node;
                }
                if (path.length() == delim + 1) {
                    final Node<V> trailingSlashNode = node.child('/');
                    return trailingSlashNode != null ? trailingSlashNode : node;
                }
                next = delim;
                break;
            default:
                throw new Error("Should not reach here");
        }

        // The path is not matched to this node, but it is possible to be matched on my children
        // because the path starts with the path of this node. So we need to visit children as the
        // following sequences:
        //  - The child which is able to consume the next character of the path.
        //  - The child which has a path variable.
        //  - The child which is able to consume every remaining path. (catch-all)

        Node<V> child = node.child(path.charAt(next));
        if (child != null) {
            final Node<V> found = findNode(child, path, next, exact);
            if (found != null) {
                return found;
            }
        }
        child = node.parameterChild();
        if (child != null) {
            final Node<V> found = findNode(child, path, next, exact);
            if (found != null) {
                return found;
            }
        }
        child = node.catchAllChild();
        if (child != null) {
            return child;
        }

        return null;
    }
440119
function getDomPath(target, isAllDom){
        var arrAllPaths = [];
        var node = target, path;
        while(node){
            var nodeName = node.nodeName.toLowerCase();
            if(/^#document/.test(nodeName)){
                path = getRelativeDomPath(node, target, isAllDom);
                if(path){
                    arrAllPaths.push(path);
                }
                node = node.parentNode || node.host;
                target = node;
            }
            else{
                node = node.parentNode || node.host;
            }
        }
        return arrAllPaths.length > 0 ? arrAllPaths.reverse().join(' /deep/ ') : null;
    }
364664
function() {
      var path = this.decodeFragment(this.location.pathname);
      var rootPath = path.slice(0, this.root.length - 1) + '/';
      return rootPath === this.root;
    }
803454
def findByNodePath(self, nodePath):
        
        def _auxGetByPath(parts, item):
            "Aux function that does the actual recursive search"
            #logger.debug("_auxGetByPath item={}, parts={}".format(item, parts))

            if len(parts) == 0:
                return item

            head, tail = parts[0], parts[1:]
            if head == '':
                # Two consecutive slashes. Just go one level deeper.
                return _auxGetByPath(tail, item)
            else:
                childItem = item.childByNodeName(head)
                return _auxGetByPath(tail, childItem)

        # The actual body of findByNodePath starts here

        check_is_a_string(nodePath)
        assert not nodePath.startswith('/'), "nodePath may not start with a slash"

        if not nodePath:
            raise IndexError("Item not found: {!r}".format(nodePath))

        return _auxGetByPath(nodePath.split('/'), self)
97538
function (node) {
                    var data = {},
                        names = self.getPointerNames(node),
                        i;
                    for (i = 0; i < names.length; i++) {
                        data[names[i]] = self.getPointerPath(node, names[i]);
                    }
                    return data;
                }
1347044
def root_hash
      # TODO: can I memoize computation below?
      return BLANK_ROOT if @root_node == BLANK_NODE

      raise InvalidNode, "invalid root node" unless @root_node.instance_of?(Array)

      val = FastRLP.encode @root_node
      key = Utils.keccak256 val

      @db.put key, val
      SPV.grabbing @root_node

      key
    end
1216178
@SuppressWarnings("unchecked")
	public TreeNode<T> findByPath(T... path) {
		return findByPath(Arrays.asList(path));
	}