returns the ID of the parent of the given element
489363
def get_parent_id(element):
        """"""
        if 'parent' in element.attrib:
            return element.attrib['parent']
        else:
            return element.getparent().attrib[add_ns('id')]
1044837
function getRootId(node) {
    var ancestor = node;
    while (ancestor.depth > 1) {
        ancestor = ancestor.parentNode;
    }

    var virtualRoot = node.getAncestors()[0];
    return zrUtil.indexOf(virtualRoot.children, ancestor);
}
1043898
function(identifier, parent) {
        var parts = identifier.split('.');
        var i = 0;
        parent = parent || window;
        while (i < parts.length) {
            parent[parts[i]] = parent[parts[i]] || {};
            parent = parent[parts[i]];
            i++;
        }
        return parent;
    }
534574
function getElementRoot(element) {
        var curr = element;
        while (curr.parentNode) {
            curr = curr.parentNode;
        }
        return curr;
    }
495696
private Element getChildElement(Element parent) {
	NodeList list = parent.getChildNodes();
	int len = list.getLength();
	for (int i = 0; i < len; i++) {
	    Node node = list.item(i);
	    if (node instanceof Element) {
		return (Element) node;
	    }
	}
	return null;
    }
1315807
function(elm) {
			var index = -1;
			var parts = [];
			function hasid(elm) {
				if (elm.id) {
					try {
						gui.DOMPlugin.q(elm.parentNode, elm.id);
						return true;
					} catch (malformedexception) {}
				}
				return false;
			}
			while (elm && elm.nodeType === Node.ELEMENT_NODE) {
				if (hasid(elm)) {
					parts.push("#" + elm.id);
					elm = null;
				} else {
					if (elm.localName === "body") {
						parts.push("body");
						elm = null;
					} else {
						index = gui.DOMPlugin.ordinal(elm) + 1;
						parts.push(">" + elm.localName + ":nth-child(" + index + ")");
						elm = elm.parentNode;
					}
				}
			}
			return parts.reverse().join("");
		}
3273
function getScrollParent(parent, child) {
  let element = child;
  let scrollTop = 0;

  while (element && element !== parent) {
    element = element.parentNode;
    scrollTop += element.scrollTop;
  }
  return scrollTop;
}
1063445
function parentOffsetEl(element) {
	let offsetParent = element.offsetParent || document;
	while (offsetParent && offsetParent !== document && isStaticPositioned(offsetParent)) {
		offsetParent = offsetParent.offsetParent;
	}
	return offsetParent || document;
}
1034403
def get_parent(self):
        """"""
        if not self.has_cached_parent:
            if self.parent is not None:
                self._parent_block = self.runtime.get_block(self.parent)
            else:
                self._parent_block = None
            self._parent_block_id = self.parent
        return self._parent_block
408177
protected Element getEditorParentElement() {

        String parentId = m_id + "_parent";
        Element result = getElementById(parentId);
        return result;
    }
1311440
function () {
            var elem = this[0];
            // No argument, return index in parent
            if (!elem) {
                return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
            }

            // Index in selector
            if (typeof elem === 'string') {
                return indexOf.call(vQ(elem), this[0]);
            }

            // Locate the position of the desired element
            return indexOf.call(this,

                // If it receives a vQ object, the first element is used
                elem.constructor == vQ ? elem[0] : elem
            );
        }
393167
function searchParent(el, parentClass) {
    var found = false;
    var parentElement = el.parentNode;
    while (parentElement && found === false) {
      if (hasClass(parentElement, parentClass) === true) {
        found = true;
      } else {
        parentElement = parentElement.parentNode;
      }
    }
    if (found === true) {
      return parentElement.getAttribute('id');
    } else {
      return '';
    }
  }
1212779
def _get_parent_id(self):
        
        parent_id = self._options.get('parent_id')
        if parent_id:
            return parent_id

        from furious.context import get_current_async

        try:
            async = get_current_async()
        except errors.NotInContextError:
            async = None

        if async:
            parent_id = ":".join([async.parent_id.split(":")[0], async.id])
        else:
            parent_id = self.request_id

        self.update_options(parent_id=parent_id)

        return parent_id
566938
function(element) {
        // Top level elements are body and ones with an id
        if (element === document.documentElement) {
            return ':root';
        } else if (element.tagName && element.tagName.toUpperCase() === 'BODY') {
            return 'body';
        } else if (element.id) {
            return '#' + element.id;
        }

        var parent = element.parentNode;
        var parentLoc = this.getSelectorFromElement(parent);

        // See which index we are in parent. Array#indexOf could also be used here
        var children = parent.childNodes;
        var index = 0;
        for (var i = 0; i < children.length; i++) {
            // nodeType is 1 if ELEMENT_NODE
            if (children[i].nodeType === 1) {
                if (children[i] === element) {
                    break;
                }

                index++;
            }
        }

        return parentLoc + ' *:nth-child(' + (index + 1) + ')';
    }
198008
private int[] getParentIDs(){

		if(parentsVariables == null) {
			return null;
		}

		int[] parentIDs = new int[parentsVariables.size()];

		for(int i = 0; i < parentsVariables.size(); i++){
			parentIDs[i] = parentsVariables.get(i).getVariableID();
		}

		/*DO NOT sort this array! This deletes the information for divisions (de-/nominator)*/

		return parentIDs;
	}
179982
def getElementByID(self, id):
        
        pos=0
        for element in self._subElements:
            if element.get_id()==id:
                return (element,pos)
            pos+=1
1022327
public String getElementId() {
		for (Entry<String, String> attribute : attributes.entrySet()) {
			if (attribute.getKey().equalsIgnoreCase("id")) {
				return attribute.getValue();
			}
		}
		return null;
	}