Paths are arrays, where [] is the root node
325001
function Manipulate(path, prop, value, oldvalue) {
  this.path = path
  this.prop = prop
  this.value = value
  this.oldvalue = oldvalue || null
  this.type = 'Manipulate'
}
652511
function _mapInAttributes(&$root, $path, $asn1)
    {
        $attributes = &$this->_subArray($root, $path);

        if (is_array($attributes)) {
            for ($i = 0; $i < count($attributes); $i++) {
                $id = $attributes[$i]['type'];
                /* $value contains the DER encoding of an ASN.1 value
                   corresponding to the attribute type identified by type */
                $map = $this->_getMapping($id);
                if (is_array($attributes[$i]['value'])) {
                    $values = &$attributes[$i]['value'];
                    for ($j = 0; $j < count($values); $j++) {
                        $value = $asn1->encodeDER($values[$j], $this->AttributeValue);
                        $decoded = $asn1->decodeBER($value);
                        if (!is_bool($map)) {
                            $mapped = $asn1->asn1map($decoded[0], $map);
                            if ($mapped !== false) {
                                $values[$j] = $mapped;
                            }
                            if ($id == 'pkcs-9-at-extensionRequest' && $this->_isSubArrayValid($values, $j)) {
                                $this->_mapInExtensions($values, $j, $asn1);
                            }
                        } elseif ($map) {
                            $values[$j] = base64_encode($value);
                        }
                    }
                }
            }
        }
    }
1226873
function _expandNestedPaths(paths) {
  var expandedPaths = [];

  _pathsArray(paths).forEach(function (p) {
    if (p.indexOf('.') !== -1) {
      var pathsWithRoots = p.split('.').map(function (value, index, array) {
        return array.slice(0, index + 1).join('.');
      });

      expandedPaths = expandedPaths.concat(pathsWithRoots);
    } else {
      expandedPaths.push(p);
    }
  });

  return expandedPaths;
}
1325515
function (rootNode) {
        if (!this._parent) {
            return '/';
        }

        var current = this._parent;
        var path = this.name;
        while (current._parent) {
            path = current.name + '/' + path;
            if (current._parent == rootNode) {
                break;
            }
            current = current._parent;
        }
        if (!current._parent && rootNode) {
            return null;
        }
        return path;
    }
597288
function() {
    var dir, leaf, name, names, root, _i, _j, _len, _name;
    root = arguments[0], names = 3 <= arguments.length ? __slice.call(arguments, 1, _i = arguments.length - 1) : (_i = 1, []), name = arguments[_i++];
    leaf = this;
    dir = path.resolve(root);
    for (_j = 0, _len = names.length; _j < _len; _j++) {
      _name = names[_j];
      if (!isObject(leaf[_name])) {
        leaf[_name] = {};
      }
      leaf = leaf[_name];
      dir = path.resolve(dir, _name);
    }
    if (name == null) {
      name = path.basename(dir, path.extname(dir));
      dir = path.dirname(dir);
    }
    walk(leaf, dir, name);
    return this;
  }
1067193
function (path) {
      var paths = this._paths;
      paths[path] = (paths[path] || 0) + 1;

      var key = firstKey(path);
      var tail = path.slice(key.length + 1);

      this.chain(key, tail);
    }
20861
function getItems(obj, path) {
        var pathItems = Array.isArray(path) ? path : path.split('.'),
            elm = obj,
            items = [];

        pathItems.some(function (key, index) {
            var isLastKey = (index + 1 === pathItems.length);
            elm = elm[key];

            if (elm === undefined) {
                return false;
            }

            if (Array.isArray(elm)) {
                elm.forEach(function (val) {
                    if (isLastKey) {
                        items.push(val);
                    } else {
                        items = items.concat(getItems(val, pathItems.slice(index + 1)));
                    }
                });
                return true;
            }

            // not array, so, object or primitive
            if (isLastKey) {
                items.push(elm);
                return true;
            }

            return false;
        });

        return items;
    }
312232
function getPathValue(node, path) {
	let names = path.split("."), name;

	while ( name = names.shift() ) {
		if (node == null) {
			return names.length ? void 0 : null;
		}
		node = node[name];
	}

	return node;
}
469894
def _get_node_path(self, node):
        """"""
        path = []
        while node.up:
            path.append(node.name)
            node = node.up
        return list(reversed(path))
783797
function PathNotFoundError(path, sympath){
  superError.call(
    this,
    'PathNotFoundError',
    util.format('Path was not found in the tree: %s', sympath)
  );

  this.arrayPath = path;
  this.sympath = sympath;
}
983248
function (target, path, traverseArrays) {
      
      // if traversing arrays is enabled and this is an array, loop
      // may be a "array-like" node list (or similar), in which case it needs to be converted
      if (traverseArrays && Sysmo.isArrayLike(target)) {
        
        target = Sysmo.makeArray(target);
        
        var children = [];
        
        for (var i = 0; i < target.length; i++) {
          // recursively loop through children
          var child = Sysmo.getDeepValue(target[i], path, traverseArrays);
          
          // ignore if undefined
          if (typeof child != "undefined") {
            //flatten array because the original path points to one flat result set
            if (Sysmo.isArray(child)) {
              
              for (var j = 0; j < child.length; j++) {
                children.push(child[j]);
              }
              
            } else {
              
              children.push(child);
              
            }
          }
        }
        
        return (children.length) ? children : void(0);
      }
      
      var invoke_regex = /\(\)$/,
          properties = path.split('.'),
          property;

      if (target != null && properties.length) {
        
        var propertyName = properties.shift(),
            invoke = invoke_regex.test(propertyName)
        
        if (invoke) {
          propertyName = propertyName.replace(invoke_regex, "");
        }
        
        if (invoke && propertyName in target) {
          target = target[propertyName]();
        } else {
          target = target[propertyName];
        }
        
        path = properties.join('.');
        
        if (path) {
          target = Sysmo.getDeepValue(target, path, traverseArrays);
        }
      }
      
      return target;
    }
617443
function leafs($path) {
		/** @var array(string => string) $result */
		$result = [];
		/** @var X[] $nodes */
		$nodes = $this->xpathA($path);
		foreach ($nodes as $node) {
			/** @var X $node */
			$result[] = df_leaf_s($node);
		}
		return $result;
	}
836351
function createPath(root, item) {
        var paths = item.parent.split('/'),
            dir, prevEl, el;

        if (paths && paths.length) {
            paths.forEach(function (path, index) {
                dir = paths.slice(0, index + 1).join('/');
                el = root.find(dir);

                if (!el) {
                    el = et.SubElement(prevEl ? prevEl : root, path, {});
                }

                prevEl = el;
            });
        }

        return root.find(item.parent || root.find('*/' + item.parent));
    }
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;
			}
162706
function parse(tokens, basePath, iterSuffix) {
  const len = tokens.length;
  const body = [];

  let i = 0;
  while (i < len) {
    const token = tokens[i];
    if (subroutines[token.tokenType]) {
      const rest = tokens.slice(i + 1);
      const [
        branches,
        tokensHandled,
        shouldBreak,
      ] = subroutines[token.tokenType](token, rest, basePath, iterSuffix);

      body.push(...branches);

      i += tokensHandled;

      if (shouldBreak) {
        break;
      }
    } else {
      i += 1;
    }
  }

  return [body, i + 1];
}
865478
function getProp (obj, path, isArray) {
  var next;
  path = _.isString(path) ? path.split('.') : path;

  // We have more traversing to do
  if (path.length > 1) {
    next = path.shift();
    if (_.isArray(obj[next])) {
      isArray = true;
      var arr = _.compact(_.flatten(obj[next].map(function (el, i) {
        return getProp(el, _.clone(path), isArray);
      })));
      return arr.length ? arr : undefined;
    } else {
      if (!obj[next]) { return; }
      return getProp(obj[next], path, isArray);
    }

  // No more traversing. We can now target the final node with path[0]
  } else {
    next = path[0];
    // if we are at the end of the path and `obj` is an array
    if (_.isArray(obj)) {
      return _.pluck(obj, next);
    } else {
      if (!obj[next]) { return; }
      return isArray ? [obj[next]] : obj[next];
    }
  }
}
1037416
function parents() {
                var parent = void 0,
                    path = [];

                while (!!(parent = el.parentNode)) {
                    path.push(parent);
                    el = parent;
                }

                return path;
            }