Get descendants.
178623
def get_descendants(self, el, tags=True, no_iframe=False):
        """"""

        if not no_iframe or not self.is_iframe(el):
            next_good = None
            for child in el.descendants:

                if next_good is not None:
                    if child is not next_good:
                        continue
                    next_good = None

                is_tag = self.is_tag(child)

                if no_iframe and is_tag and self.is_iframe(child):
                    if child.next_sibling is not None:
                        next_good = child.next_sibling
                    else:
                        last_child = child
                        while self.is_tag(last_child) and last_child.contents:
                            last_child = last_child.contents[-1]
                        next_good = last_child.next_element
                    yield child
                    if next_good is None:
                        break
                    # Coverage isn't seeing this even though it's executed
                    continue  # pragma: no cover

                if not tags or is_tag:
                    yield child
27902
def get_inheritors(cls):
    """"""
    subclasses = set()
    work = [cls]
    while work:
        parent = work.pop()
        for child in parent.__subclasses__():
            if child not in subclasses:
                subclasses.add(child)
                work.append(child)
    return subclasses
971214
public final List<T> getAncestors() {
      List<T> path = new ArrayList<>();
      HierarchicalEnumValue<T> hev = Cast.as(this);
      do {
         hev = Cast.as(hev.getParent());
         if (hev != null && hev != getSingleRoot()) {
            path.add(Cast.as(hev));
         }
      } while (hev != null && hev != getSingleRoot());
      return path;
   }
925504
private Set<DagNode<T>> getAncestorNodes(Set<DagNode<T>> dagNodes) {
    Set<DagNode<T>> ancestorNodes = new HashSet<>();
    for (DagNode<T> dagNode : dagNodes) {
      LinkedList<DagNode<T>> nodesToExpand = Lists.newLinkedList(this.getParents(dagNode));
      while (!nodesToExpand.isEmpty()) {
        DagNode<T> nextNode = nodesToExpand.poll();
        ancestorNodes.add(nextNode);
        nodesToExpand.addAll(this.getParents(nextNode));
      }
    }
    return ancestorNodes;
  }
892760
def _descendants(self):
        
        children = self._children
        if children is not None:
            for child in children.values():
                yield from child._descendants
                yield child
1326733
def add_descendants(self, node, updateset=None):
        ""
        someset = set()
        startnode = self.tab[node]

        defout = startnode.default[0]
        if defout is not None:
            someset.add(defout)
        for kwd, matchnode in startnode.named.items():
            if matchnode[0] is not None:
                someset.add(matchnode[0])

        if someset is not None:
            updateset.update(someset)
        else:
            return someset
226739
def getDescendant(Ancestor, RouteParts):
  
  """
  if not RouteParts:
    return Ancestor

  Resolved = Ancestor.Members.get(RouteParts.pop(0))

  if isinstance(Resolved, Group):
    return getDescendant(Resolved, RouteParts)

  else:
    return Resolved
433353
def get_children(self, path, watch=None):
        """"""
        _log.debug(
            "ZK: Getting children of {path}".format(path=path),
        )
        return self.zk.get_children(path, watch)
1194612
public function getChildren()
    {
        if($this->children === null)
        {
            $this->children = $this->getDescendants(1);
        }

        return $this->children;
    }
474769
def get_children(self):
        """"""
        if self.is_leaf():
            return get_result_class(self.__class__).objects.none()
        return get_result_class(self.__class__).objects.filter(
            depth=self.depth + 1,
            path__range=self._get_children_path_interval(self.path)
        ).order_by(
            'path'
        )
606545
def descendants(self, typename):
        """"""
        xs = []
        for child in self._hier[typename][1]:
            xs.append(child)
            xs.extend(self.descendants(child))
        return xs
1077367
def get_item_children(item):
    """"""
    children = [item.child(index) for index in range(item.childCount())]
    for child in children[:]:
        others = get_item_children(child)
        if others is not None:
            children += others
    return sorted(children, key=lambda child: child.line)
622916
def parseBranches(self, descendants):
        
        parsed, parent, cond = [], False, lambda b: (b.string or '').strip()
        for branch in filter(cond, descendants):
            if self.getHeadingLevel(branch) == self.depth:
                parsed.append({'root':branch.string, 'source':branch})
                parent = True
            elif not parent:
                parsed.append({'root':branch.string, 'source':branch})
            else:
                parsed[-1].setdefault('descendants', []).append(branch)
        return [TOC(depth=self.depth+1, **kwargs) for kwargs in parsed]
519819
def descendants
      nodes = []
      children.each do |c|
        nodes << c
        nodes << c.descendants
      end
      nodes.flatten
    end
423747
def _get_descendants_errors(self):  # type: () -> List(ConfigError)
        """"""
        descendants_errors = []
        if hasattr(self, '_children'):
            if isinstance(self._children, (list, tuple)):
                for c in self._children:
                    descendants_errors += c._get_all_errors()
            elif isinstance(self._children, dict):
                for c in self._children.values():
                    descendants_errors += c._get_all_errors()

        return descendants_errors
176884
public function getAncestors()
    {
        $ancestors = new Collection();

        $ancestor = $this;

        while (($ancestor = $ancestor->parent) && !$ancestors->contains($ancestor)) {
            $ancestors->push($ancestor);
            break;
        }

        return $ancestors;
    }
1340144
def GetAncestors(self):
    
    current = self
    while True:
      current = current.GetParent()
      if current is None:
        return
      yield current