Get an instance of the traverser for the given hierarchical key.

@param array $key_path Hierarchical key path within the current data to traverse to.

@throws NonExistentKeyException

@return static
507133
public function traverse_to( array $key_path ) {
		$current = array_shift( $key_path );

		if ( null === $current ) {
			return $this;
		}

		if ( ! $this->exists( $current ) ) {
			$exception = new NonExistentKeyException( "No data exists for key \"{$current}\"" );
			$exception->set_traverser( new static( $this->data, $current, $this->parent ) );
			throw $exception;
		}

		foreach ( $this->data as $key => &$key_data ) {
			if ( $key === $current ) {
				$traverser = new static( $key_data, $key, $this );
				return $traverser->traverse_to( $key_path );
			}
		}
	}
8203
def query_key(path)
      i = 0
      path.map do |v|
        i += 1
        if i != 1
          "[#{v}]"
        else
          v
        end
      end.join('')
    end
456401
private function createRecursive($path)
    {
        $treeWalker = $this->getTreeWalker();
        $name = basename($path);
        $parentPath = dirname($path);
        if (!($parentTree = $treeWalker->walk($parentPath))) {
            $parentTree = $this->createRecursive($parentPath);
        }

        return $this->treeManager->createTree($name, $parentTree);
    }
1195084
def GetSubkeyByPath(self, key_path):
    
    subkey = self
    for path_segment in key_paths.SplitKeyPath(key_path):
      subkey = subkey.GetSubkeyByName(path_segment)
      if not subkey:
        break

    return subkey
983630
def get_value_from_path(self, keypath):
        
        if isinstance(keypath, list):
            if len(keypath) == 0:
                # empty list is root
                return 
            val = self 
            for next_key in keypath:
                val = val[next_key]
            return val
        else:
            return self.__dict__['p'][keypath]
664764
public function classSessionToPostData ($key_list = [], $parent_path_list = []) {
		$key_list = (array) $key_list;
		$key_list = empty($key_list) ? static::GetClassSessionNames() : $key_list;

		$parent_path_list = (array) $parent_path_list;

		if (empty($parent_path_list)) {
			foreach ($key_list as $key) {
				static::overWritePostData($key, static::ReadClassSession($key));
			}
		} else {
			$class_session = static::ReadClassSession($parent_path_list);
			foreach ($key_list as $key) {
				static::overWritePostData($key, isset($class_session[$key]) ? $class_session[$key] : null);
			}
		}
	}
1357700
def get_cmd_by_path(self, existed_cmd_path):
        
        parent = self.tree
        for cmd_name in existed_cmd_path:
            try:
                parent = parent['children'][cmd_name]
            except KeyError:
                raise ValueError(
                    "Given key [%s] in path %s does not exist in tree."
                    % (cmd_name, existed_cmd_path)
                )
        return parent
998544
public function getKeys($path)
    {
        if (empty($path)) {
            return array_keys($this->map->getContainer());
        }
        $value = $this->map[$path];
        if (is_array($value)) {
            return array_keys($value);
        } else {
            return false;
        }

    }
874966
def GetSubkeyByPath(self, key_path):
    
    if not self._registry_key and self._registry:
      self._GetKeyFromRegistry()

    subkey = self
    for path_segment in key_paths.SplitKeyPath(key_path):
      subkey = subkey.GetSubkeyByName(path_segment)
      if not subkey:
        break

    return subkey
1084112
public function getChildByPath($path)
    {
        if (!is_array($path)) {
            $path = trim($path, " /");
            $pieces = explode("/", $path);
        } else {
             $pieces = $path;
        }
            
        if (!sizeof($pieces)) return $this;

        if ($alias = array_shift($pieces)) {

                $c = $this->getChildByAlias($alias);
                if (sizeof($pieces)) {
                    return $c->getChildByPath($pieces);
                } else {
                    return $c;
                }

        }
        return $this;
    }
1253132
public function get($path = null) {
		// return full tree
		if (is_null($path)) return $this->_tree;

		if (!isset($this->_nodes[$path])) {
			throw new \Exception(__METHOD__.': path "'.$path.'" does not exist.');
			return;
		}
		return $this->_nodes[$path];
	}
444179
protected function &get_node($path, &$data_arr)
    {
        $node = &$data_arr;
        if (!empty($path)) {
            foreach ((array)$path as $key) {
                if (!isset($node[$key]))
                    $node[$key] = array();
                $node = &$node[$key];
            }
        }

        return $node;
    }
975399
public static function at($path)
    {
        $file = new static($path);

        if (! $file->exists()) {
            throw new NonExistentFileException("File does not exist at $path");
        }

        if (! $file->isReadable()) {
            throw new FilePermissionsException("File not readable at $path");
        }

        return $file;
    }
1170448
def GetKeyByPath(self, key_path):
    
    key_path_upper = key_path.upper()
    if key_path_upper.startswith(self._key_path_prefix_upper):
      relative_key_path = key_path[self._key_path_prefix_length:]
    elif key_path.startswith(definitions.KEY_PATH_SEPARATOR):
      relative_key_path = key_path
      key_path = ''.join([self._key_path_prefix, key_path])
    else:
      return None

    path_segments = key_paths.SplitKeyPath(relative_key_path)
    registry_key = self._root_key
    if not registry_key:
      return None

    for path_segment in path_segments:
      registry_key = registry_key.GetSubkeyByName(path_segment)
      if not registry_key:
        return None

    return registry_key
812588
public function key()
    {
        if (is_null($this->current)) {
            return $this->getUniqueKey();
        }
        if ($this->current instanceof RecursiveLeafInterface) {
            return $this->current->key();
        }
    }
956668
def _get(self, node_hash, keypath):
        
        # Empty trie
        if node_hash == BLANK_HASH:
            return None
        nodetype, left_child, right_child = parse_node(self.db[node_hash])
        # Key-value node descend
        if nodetype == LEAF_TYPE:
            if keypath:
                return None
            return right_child
        elif nodetype == KV_TYPE:
            # Keypath too short
            if not keypath:
                return None
            if keypath[:len(left_child)] == left_child:
                return self._get(right_child, keypath[len(left_child):])
            else:
                return None
        # Branch node descend
        elif nodetype == BRANCH_TYPE:
            # Keypath too short
            if not keypath:
                return None
            if keypath[:1] == BYTE_0:
                return self._get(left_child, keypath[1:])
            else:
                return self._get(right_child, keypath[1:])
1013985
public function getNodeForPath($path)
    {
        $path = trim($path, '/');
        if (isset($this->cache[$path])) {
            return $this->cache[$path];
        }

        // Is it the root node?
        if (!strlen($path)) {
            return $this->rootNode;
        }

        // Attempting to fetch its parent
        list($parentName, $baseName) = Uri\split($path);

        // If there was no parent, we must simply ask it from the root node.
        if ('' === $parentName) {
            $node = $this->rootNode->getChild($baseName);
        } else {
            // Otherwise, we recursively grab the parent and ask him/her.
            $parent = $this->getNodeForPath($parentName);

            if (!($parent instanceof ICollection)) {
                throw new Exception\NotFound('Could not find node at path: '.$path);
            }
            $node = $parent->getChild($baseName);
        }

        $this->cache[$path] = $node;

        return $node;
    }