Returns the common parent of N elements.
427001
@SafeVarargs
	public static <T> Optional<T> lowestCommonAncestor(TreeDef.Parented<T> treeDef, T... nodes) {
		return lowestCommonAncestor(treeDef, Arrays.asList(nodes));
	}
1186971
public Flowable<Tree<T>> parents() {
    return Flowable.generate(() -> Wrapper.of(this), (n, e) -> {
      Tree<T> parent = n.get().getParent();
      if (parent != null) {
        e.onNext(parent);
        n.set(parent);
      } else {
        e.onComplete();
      }
    });
  }
932546
@Override
    public double[][] selectParents() {
        double[][] parents = new double[2][];

        int parent1Idx = rng.nextInt(population.size());
        int parent2Idx;
        do {
            parent2Idx = rng.nextInt(population.size());
        } while (parent1Idx == parent2Idx);

        parents[0] = population.get(parent1Idx).getGenes();
        parents[1] = population.get(parent2Idx).getGenes();

        return parents;
    }
1338766
private static List<Element> filterParents(List<Element> elements) {
		List<Element> filtered = new ArrayList<Element>();
		for (Element element : elements) {
			// get the intersection of parents and selected elements
			List<Element> parentsInter = element.parents();
			parentsInter.retainAll(elements);
			if (parentsInter.isEmpty()) {
				// no intersection - element's parents are not in the selected list
				filtered.add(element);
			}
		}

		return filtered;
	}
875988
public static IntArrayList getChildrenOf(int[] parents, int parent) {
        IntArrayList children = new IntArrayList();
        for (int i=0; i<parents.length; i++) {
            if (parents[i] == parent) {
                children.add(i);
            }
        }
        return children;
    }
1307921
def get_parent_bin_nodes(self):
        
        parent_bin_nodes = []
        for node in self._my_map['parentNodes']:
            parent_bin_nodes.append(BinNode(
                node._my_map,
                runtime=self._runtime,
                proxy=self._proxy,
                lookup_session=self._lookup_session))
        return BinNodeList(parent_bin_nodes)
713219
def n_parent_paths(self, n):
        
        rv = os.path.relpath(os.path.join(self.path, '..'), os.path.join(self.path, *['..'] * (n+1)))
        return rv.replace('\\', '/')
1026392
def get_all_parents(self):
        """"""
        all_parents = set()
        for parent in self.parents:
            all_parents.add(parent.item_id)
            all_parents |= parent.get_all_parents()
        return all_parents
7213
function findCommonOffsetParent(element1, element2) {
  // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
    return document.documentElement;
  }

  // Here we make sure to give as "start" the element that comes first in the DOM
  const order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
  const start = order ? element1 : element2;
  const end = order ? element2 : element1;

  // Get common ancestor container
  const range = document.createRange();
  range.setStart(start, 0);
  range.setEnd(end, 0);
  const { commonAncestorContainer } = range;

  // Both nodes are inside #document
  if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
    if (isOffsetContainer(commonAncestorContainer)) {
      return commonAncestorContainer;
    }

    return getOffsetParent(commonAncestorContainer);
  }

  // one of the nodes is inside shadowDOM, find which one
  const element1root = getRoot(element1);
  if (element1root.host) {
    return findCommonOffsetParent(element1root.host, element2);
  } else {
    return findCommonOffsetParent(element1, getRoot(element2).host);
  }
}
611811
static boolean isTryCatchNodeContainer(Node n) {
    Node parent = n.getParent();
    return parent.isTry()
        && parent.getSecondChild() == n;
  }
919654
def get_parent_element(self):
        """"""
        return {AUDIT_REF_STATE: self.context.audit_record,
                SIGNATURE_REF_STATE: self.context.signature}[self.ref_state]
489363
def get_parent_id(element):
        """"""
        if 'parent' in element.attrib:
            return element.attrib['parent']
        else:
            return element.getparent().attrib[add_ns('id')]
71499
def get_parent(self):
        
        if not self.parent:
            parent = self._safe_get_element('ParentASIN')
            if parent:
                self.parent = self.api.lookup(ItemId=parent)
        return self.parent
738468
public static List<Element> getAllChildElements(Element parent) {
        List<Element> result;
        NodeList nodes;
        int i;
        int max;
        Node node;

        result = new ArrayList<>();
        nodes = parent.getChildNodes();
        max = nodes.getLength();
        for (i = 0; i < max; i++) {
            node = nodes.item(i);
            if (node instanceof Element) {
                result.add((Element) node);
            }
        }
        return result;
    }
988892
def parent(self):
        
        parent = list(self.graph.objects(self.asNode(), RDF_NAMESPACES.DTS.parent))
        if parent:
            return self.parent_class(parent[0])
        return None
551781
def _parent_tile(tiles):
    
    parent = None
    for t in tiles:
        if parent is None:
            parent = t

        else:
            parent = common_parent(parent, t)

    return parent
779693
def _root(self):
        
        _n = self
        while _n.parent:
            _n = _n.parent
        return _n