Returns any parent caret container element
770071
function getParentCaretContainer(node) {
          while (node) {
            if (node.id === caretContainerId) {
              return node;
            }

            node = node.parentNode;
          }
        }
1063445
function parentOffsetEl(element) {
	let offsetParent = element.offsetParent || document;
	while (offsetParent && offsetParent !== document && isStaticPositioned(offsetParent)) {
		offsetParent = offsetParent.offsetParent;
	}
	return offsetParent || document;
}
1320913
def get_parent(self):
        """"""

        parent_iter = self.model.iter_parent(self.iter)
        if parent_iter:
            return TreeModelRow(self.model, parent_iter)
934303
function getParentRole(elm) {
        var role, parent = elm || focusedElement;

        while ((parent = parent.parentNode)) {
          if ((role = getRole(parent))) {
            return role;
          }
        }
      }
836575
function( includeSelf, ignoreTextNode ) {
			var start = this.startContainer,
				end = this.endContainer,
				ancestor;

			if ( start.equals( end ) ) {
				if ( includeSelf && start.type == CKEDITOR.NODE_ELEMENT && this.startOffset == this.endOffset - 1 )
					ancestor = start.getChild( this.startOffset );
				else
					ancestor = start;
			} else {
				ancestor = start.getCommonAncestor( end );
			}

			return ignoreTextNode && !ancestor.is ? ancestor.getParent() : ancestor;
		}
1119198
def parent
      assert_exists

      obj = @object.parentNode
      until element_class = Celerity::Util.htmlunit2celerity(obj.class)
        return nil if obj.nil?
        obj = obj.parentNode
      end

      element_class.new(@container, :object, obj)
    end
1146202
function checkIfStyleCanBeChildOf( def, currentParent, elementName, isUnknownElement ) {
		return currentParent &&
			( ( currentParent.getDtd() || CKEDITOR.dtd.span )[ elementName ] || isUnknownElement ) &&
			( !def.parentRule || def.parentRule( currentParent ) );
	}
755829
def _get_parent(root):
    

    elem = root

    while True:
        elem = elem.getparent()

        if elem.tag in ['ul', 'ol']:
            return elem
1251255
def get_parent(self):
        """"""
        return None if self.zoom == 0 else self.tile_pyramid.tile(
            self.zoom - 1, self.row // 2, self.col // 2
        )
881292
function getContainer(element, prop) {

	var cache;
	if (containerCache.has(element)) {
		cache = containerCache.get(element);
		if (cache[prop]) {
			return cache[prop];
		}
	}
	else {
		cache = {};
		containerCache.set(element, cache);
	}

	if (element === documentElement) {
		cache[prop] = element;
	}

	else if (prop !== 'width' && prop !== 'height') {
		// Skip transparent background colors
		if (prop === 'background-color' && !parseColor(getComputedStyle(element).getPropertyValue(prop))[3]) {
			cache[prop] = getContainer(element.parentNode, prop);
		}
		else {
			cache[prop] = element;
		}
	}

	// Skip inline elements
	else if (getComputedStyle(element).display === 'inline') {
		cache[prop] = getContainer(element.parentNode, prop);
	}

	else if (isFixedSize(element, prop)) {
		cache[prop] = element;
	}

	else {

		var parentNode = element.parentNode;

		// Skip to next positioned ancestor for absolute positioned elements
		if (getComputedStyle(element).position === 'absolute') {
			while (
				parentNode.parentNode
				&& parentNode.parentNode.nodeType === 1
				&& ['relative', 'absolute'].indexOf(getComputedStyle(parentNode).position) === -1
			) {
				parentNode = parentNode.parentNode;
			}
		}

		// Skip to next ancestor with a transform applied for fixed positioned elements
		if (getComputedStyle(element).position === 'fixed') {
			while (
				parentNode.parentNode
				&& parentNode.parentNode.nodeType === 1
				&& [undefined, 'none'].indexOf(
					getComputedStyle(parentNode).transform
					|| getComputedStyle(parentNode).MsTransform
					|| getComputedStyle(parentNode).WebkitTransform
				) !== -1
			) {
				parentNode = parentNode.parentNode;
			}
		}

		var parentContainer = getContainer(parentNode, prop);
		while (getComputedStyle(parentNode).display === 'inline') {
			parentNode = parentNode.parentNode;
		}
		if (parentNode === parentContainer && !isIntrinsicSize(element, prop)) {
			cache[prop] = element;
		}
		else {
			cache[prop] = parentContainer;
		}
	}

	return cache[prop];

}
339201
def get_child_value(parent, name, allow_missing=0):
        
        if not parent.hasElement(name):
            if allow_missing:
                return np.nan
            else:
                raise Exception('failed to find child element %s in parent' % name)
        else:
            return XmlHelper.as_value(parent.getElement(name))
1340623
function (parent) {

            var renderer = this.renderer,
              parentWrapper = parent || renderer,
              parentNode = parentWrapper.element || renderer.box,
              childNodes,
              element = this.element,
              zIndex = this.zIndex,
              otherElement,
              otherZIndex,
              i,
              inserted;

            if (parent) {
                this.parentGroup = parent;
            }

            // mark as inverted
            this.parentInverted = parent && parent.inverted;

            // build formatted text
            if (this.textStr !== undefined) {
                renderer.buildText(this);
            }

            // mark the container as having z indexed children
            if (zIndex) {
                parentWrapper.handleZ = true;
                zIndex = pInt(zIndex);
            }

            // insert according to this and other elements' zIndex
            if (parentWrapper.handleZ) { // this element or any of its siblings has a z index
                childNodes = parentNode.childNodes;
                for (i = 0; i < childNodes.length; i++) {
                    otherElement = childNodes[i];
                    otherZIndex = attr(otherElement, 'zIndex');
                    if (otherElement !== element && (
                          // insert before the first element with a higher zIndex
                        pInt(otherZIndex) > zIndex ||
                            // if no zIndex given, insert before the first element with a zIndex
                        (!defined(zIndex) && defined(otherZIndex))

                      )) {
                        parentNode.insertBefore(element, otherElement);
                        inserted = true;
                        break;
                    }
                }
            }

            // default: append at the end
            if (!inserted) {
                parentNode.appendChild(element);
            }

            // mark as added
            this.added = true;

            // fire an event for internal hooks
            if (this.onAdd) {
                this.onAdd();
            }

            return this;
        }
52624
function(root,new$,old,caret) {
	
	// var skipnew = new == null or new === false or new === true
	var newIsNull = new$ == null || new$ === false;
	var oldIsNull = old == null || old === false;
	
	
	if (new$ === old) {
		// remember that the caret must be an actual dom element
		// we should instead move the actual caret? - trust
		if (newIsNull) {
			return caret;
		} else if (new$._slot_) {
			return new$._slot_;
		} else if ((new$ instanceof Array) && new$.taglen != null) {
			return reconcileIndexedArray(root,new$,old,caret);
		} else {
			return caret ? caret.nextSibling : root._dom.firstChild;
		};
	} else if (new$ instanceof Array) {
		if (old instanceof Array) {
			// look for slot instead?
			var typ = new$.static;
			if (typ || old.static) {
				// if the static is not nested - we could get a hint from compiler
				// and just skip it
				if (typ == old.static) { // should also include a reference?
					for (var i = 0, items = iter$(new$), len = items.length; i < len; i++) {
						// this is where we could do the triple equal directly
						caret = reconcileNested(root,items[i],old[i],caret);
					};
					return caret;
				} else {
					removeNested(root,old,caret);
				};
				
				// if they are not the same we continue through to the default
			} else {
				// Could use optimized loop if we know that it only consists of nodes
				return reconcileCollection(root,new$,old,caret);
			};
		} else if (!oldIsNull) {
			if (old._slot_) {
				root.removeChild(old);
			} else {
				// old was a string-like object?
				root.removeChild(caret ? caret.nextSibling : root._dom.firstChild);
			};
		};
		
		return self.insertNestedAfter(root,new$,caret);
		// remove old
	} else if (!newIsNull && new$._slot_) {
		if (!oldIsNull) { removeNested(root,old,caret) };
		return self.insertNestedAfter(root,new$,caret);
	} else if (newIsNull) {
		if (!oldIsNull) { removeNested(root,old,caret) };
		return caret;
	} else {
		// if old did not exist we need to add a new directly
		var nextNode;
		// if old was array or imbatag we need to remove it and then add
		if (old instanceof Array) {
			removeNested(root,old,caret);
		} else if (old && old._slot_) {
			root.removeChild(old);
		} else if (!oldIsNull) {
			// ...
			nextNode = caret ? caret.nextSibling : root._dom.firstChild;
			if ((nextNode instanceof Text) && nextNode.textContent != new$) {
				nextNode.textContent = new$;
				return nextNode;
			};
		};
		
		// now add the textnode
		return self.insertNestedAfter(root,new$,caret);
	};
}
897748
function(type) {
			var result = this.spirit.element.parentNode;
			if (type) {
				var spirit = result.spirit;
				if (spirit && spirit instanceof type) {
					result = spirit;
				} else {
					result = null;
				}
			}
			return result;
		}
881970
@Override
    public RemoteWebElement getElement() {
        /*
         * Note: Rationale behind throwing ParentNotFoundException here.
         * 
         * Container's being a parent type is searched using a locator. When the locator is invalid it will be better to
         * throw ParentNotFoundException to the user so that it clearly indicates its the container.
         */
        List<WebElement> elements = null;
        try {
            if (getParent() != null) {
                elements = getParent().locateChildElements(getLocator());
            } else {
                // Its a case where there is a stand alone container and no parent
                elements = HtmlElementUtils.locateElements(getLocator());
            }
        } catch (NoSuchElementException n) {
            throw new ParentNotFoundException("Could not find any parent with the locator " + getLocator(), n);
        }
        if (index <= elements.size()) {
            return (RemoteWebElement) elements.get(index);
        }
        throw new NoSuchElementException("Cannot find Element With index :{" + index + "} in Container"
                + this.getClass().getSimpleName());
    }
154630
def parent_element(self):
        
        def parent_element():
            """
            Wrapper to get parent element
            """
            parent = self.driver_wrapper.execute_script('return arguments[0].parentNode;', self.element)
            wrapped_parent = WebElementWrapper(self.driver_wrapper, '', parent)
            return wrapped_parent

        return self.execute_and_handle_webelement_exceptions(parent_element, 'get parent element')
167036
def parse_from_parent(
            self,
            parent,  # type: ET.Element
            state  # type: _ProcessorState
    ):
        # type: (...) -> Any
        """"""
        element = parent.find(self.element_path)

        if element is None and self.required:
            state.raise_error(
                MissingValue, 'Missing required element "{}"'.format(self.element_path)
            )
        elif element is not None:
            return self.parse_at_element(element, state)

        return _hooks_apply_after_parse(self._hooks, state, self._default)