Returns the latest (parent) old id mapped by one pathelement
966292
public function get_old_parentid($itemname) {
        return array_key_exists($itemname, $this->elementsoldid) ? $this->elementsoldid[$itemname] : null;
    }
601468
def _get_old(self):
        """"""

        def _deserialize(d):
            if not len(d):
                return {}
            return dict(l.split(self.OLD_SEPARATOR) for l in d.split('\n'))

        data, stat = self.zk.get(self.path)
        return _deserialize(data.decode('utf8')), stat.version
472690
def previousSibling(self) -> Optional[AbstractNode]:
        
        parent = self.parentNode
        if parent is None:
            return None
        return parent.childNodes.item(parent.childNodes.index(self) - 1)
1076322
function getRoute(node) {
	var id = "";

	var parent = node.parentNode;
	var index = -1;

	if(!parent) {
		return {id:"0"};
	}

	var child = parent.firstChild;
	while(child) {
		index++;
		if(child === node) {
			break;
		}
		child = child.nextSibling;
	}

	// ARG!

	var parentInfo = parent.nodeType === 9 ? {id:""} :
		getCachedInfo(parent) || getRoute(parent);

	var parentId = parentInfo.id;

	id = (parentId ? parentId + SEPARATOR : "") + index;

	var routeInfo = {
		id: id,
		branch: getBranch(index, node, parentInfo.branch)
	};
	cache(node, routeInfo);

	return routeInfo;
}
561797
def max_pathlen(self):
        

        pathlen = self.pathlen
        if self.parent is None:
            return pathlen

        max_parent = self.parent.max_pathlen

        if max_parent is None:
            return pathlen
        elif pathlen is None:
            return max_parent - 1
        else:
            return min(self.pathlen, max_parent - 1)
821193
function(newnode, oldnode, ids) {
		var updates = [];
		var news = this._assistant.index(newnode.childNodes);
		var olds = this._assistant.index(oldnode.childNodes);
		/*
		 * Add elements?
		 */
		var child = newnode.lastElementChild,
			topid = this._assistant.id(oldnode),
			oldid = null,
			newid = null;
		while (child) {
			newid = this._assistant.id(child);
			if (!olds[newid]) {
				if (oldid) {
					updates.push(
						new edbml.InsertUpdate(this._doc).setup(oldid, child)
					);
				} else {
					updates.push(
						new edbml.AppendUpdate(this._doc).setup(topid, child)
					);
				}
			} else {
				oldid = newid;
			}
			child = child.previousElementSibling;
		}
		/*
		 * Remove elements?
		 */
		Object.keys(olds).forEach(function(id) {
			if (!news[id]) {
				updates.push(
					new edbml.RemoveUpdate(this._doc).setup(id)
				);
				updates.push(
					new edbml.FunctionUpdate(this._doc).setup(id)
				);
			} else { // note that crawling continues here...
				var n1 = news[id];
				var n2 = olds[id];
				this._scan(n1, n2, n1, id, ids);
			}
		}, this);
		/*
		 * Register updates
		 */
		updates.reverse().forEach(function(update) {
			this._updates.collect(update, ids);
		}, this);
	}
996964
function getPropertyOfPath(obj, path) {
    const [child, last] = getLeafOfPath(obj, path, false);
    return child && last ? child[last] : undefined;
}
1365950
function walk (newNode, oldNode) {
  // if (DEBUG) {
  //   console.log(
  //   'walk\nold\n  %s\nnew\n  %s',
  //   oldNode && oldNode.outerHTML,
  //   newNode && newNode.outerHTML
  // )
  // }
  if (!oldNode) {
    return newNode
  } else if (!newNode) {
    return null
  } else if (newNode.isSameNode && newNode.isSameNode(oldNode)) {
    return oldNode
  } else if (newNode.tagName !== oldNode.tagName) {
    return newNode
  } else {
    _$morph_11(newNode, oldNode)
    updateChildren(newNode, oldNode)
    return oldNode
  }
}
569439
def lookup_path_inherited(namespace, path, type)
      resolved = nil
      last_obj = namespace
      scopes = []
      last_sep = nil
      pos = 0

      if path =~ /\A(#{separators_match})/
        last_sep = $1
        path = $'
      end

      path.scan(/(.+?)(#{separators_match}|$)/).each do |part, sep|
        cur_obj = nil
        pos += "#{part}#{sep}".length
        parsed_end = pos == path.length

        if !last_obj || (!parsed_end && !last_obj.is_a?(CodeObjects::NamespaceObject))
          break # can't continue
        end

        collect_namespaces(last_obj).each do |ns|
          next if ns.is_a?(CodeObjects::Proxy)

          found = nil
          search_seps = []
          scopes.each do |scope|
            search_seps += separators_for_type(scope)
          end

          if search_seps.empty?
            search_seps =
              if ns.type == :root
                [""]
              elsif last_sep.nil?
                separators
              else
                [@default_sep]
              end
          end

          ([last_sep] | search_seps).compact.each do |search_sep|
            found = @registry.at(ns.path + search_sep.to_s + part)
            break if found
          end

          break cur_obj = found if found
        end

        last_sep = sep
        scopes = types_for_separator(sep) || []
        last_obj = cur_obj
        resolved = cur_obj if parsed_end && cur_obj && (type.nil? || type == cur_obj.type)
      end

      resolved
    end
1031593
function(newnode, oldnode, lastnode, id, ids) {
		var result = true,
			oldid = this._assistant.id(oldnode);
		if ((result = this._check(newnode, oldnode, lastnode, id, ids))) {
			if (oldid) {
				ids = gui.Object.copy(ids);
				lastnode = newnode;
				ids[oldid] = true;
				id = oldid;
			}
			result = this._crawl(newnode.firstChild, oldnode.firstChild, lastnode, id, ids);
		}
		return result;
	}
303788
def last_updated(self):
        '''
        
        '''
        derived_path = self.context.request.url
        timestamp_key = self.timestamp_key_for(derived_path)

        if self.exists(self.timestamp_key_for, derived_path):
            return self.storage.get(timestamp_key)

        return None
844710
private void getLastChild() {

        // nodekey of the root of the current subtree
        final long parent = getNode().getDataKey();

        // traverse tree in pre order to the leftmost leaf of the subtree and
        // push
        // all nodes to the stack
        if (((ITreeStructData)getNode()).hasFirstChild()) {
            while (((ITreeStructData)getNode()).hasFirstChild()) {
                mStack.push(getNode().getDataKey());
                moveTo(((ITreeStructData)getNode()).getFirstChildKey());
            }

            // traverse all the siblings of the leftmost leave and all their
            // descendants and push all of them to the stack
            while (((ITreeStructData)getNode()).hasRightSibling()) {
                mStack.push(getNode().getDataKey());
                moveTo(((ITreeStructData)getNode()).getRightSiblingKey());
                getLastChild();
            }

            // step up the path till the root of the current subtree and process
            // all
            // right siblings and their descendants on each step
            if (getNode().hasParent() && (getNode().getParentKey() != parent)) {

                mStack.push(getNode().getDataKey());
                while (getNode().hasParent() && (getNode().getParentKey() != parent)) {

                    moveTo(getNode().getParentKey());

                    // traverse all the siblings of the leftmost leave and all
                    // their
                    // descendants and push all of them to the stack
                    while (((ITreeStructData)getNode()).hasRightSibling()) {

                        moveTo(((ITreeStructData)getNode()).getRightSiblingKey());
                        getLastChild();
                        mStack.push(getNode().getDataKey());
                    }
                }

                // set transaction to the node in the subtree that is last in
                // document
                // order
                moveTo(mStack.pop());
            }
        }
    }
1177033
def get_id_by_impath(path):
        '''
        
        '''
        logger.info('Get Entiry, Path: {0}'.format(path))

        entity_list = TabEntity.select().where(TabEntity.path == path)
        out_val = None
        if entity_list.count() == 1:
            out_val = entity_list.get()
        elif entity_list.count() > 1:
            for rec in entity_list:
                MEntity.delete(rec.uid)
            out_val = None
        else:
            pass
        return out_val
1096268
private Integer getNextOrdinalForMethodId(int methodId, String pathName) throws Exception {
        String pathInfo = doGet(BASE_PATH + uriEncode(pathName), new BasicNameValuePair[0]);
        JSONObject pathResponse = new JSONObject(pathInfo);

        JSONArray enabledEndpoints = pathResponse.getJSONArray("enabledEndpoints");
        int lastOrdinal = 0;
        for (int x = 0; x < enabledEndpoints.length(); x++) {
            if (enabledEndpoints.getJSONObject(x).getInt("overrideId") == methodId) {
                lastOrdinal++;
            }
        }
        return lastOrdinal + 1;
    }
743731
def lastId(self):
        
        if self._last is False:
            # Request the next urn
            self._last = self.childIds[-1]
        return self._last
489363
def get_parent_id(element):
        """"""
        if 'parent' in element.attrib:
            return element.attrib['parent']
        else:
            return element.getparent().attrib[add_ns('id')]
510196
public static String getParentPath(String path) {
        if (path == null) return null;
        path = path.trim();
        if (path.endsWith(PATH_ROOT) && path.length() > 1) {
            path = path.substring(0, path.length() - 1);
        }
        int lastIndex = path.lastIndexOf(PATH_ROOT);
        if (path.length() > 1 && lastIndex > 0) {
            return path.substring(0, lastIndex);
        }
        return PATH_ROOT;
    }