Gets generator containing all child Nodes and Tokens (direct descendants).
Does not return null elements.

@return \Generator|Token[]|Node[]
511361
public function getChildNodesAndTokens() : \Generator {
        foreach ($this::CHILD_NAMES as $name) {
            $val = $this->$name;

            if (\is_array($val)) {
                foreach ($val as $child) {
                    if ($child !== null) {
                        yield $name => $child;
                    }
                }
                continue;
            }
            if ($val !== null) {
                yield $name => $val;
            }
        }
    }
892760
def _descendants(self):
        
        children = self._children
        if children is not None:
            for child in children.values():
                yield from child._descendants
                yield child
173126
public function children(): NodeList {
        $results = $this->collection()->reduce(function($carry, $node) {
            return $carry->merge(
                $node->findXPath('child::*')
            );
        }, $this->newNodeList());

        return $results;
    }
1016866
public function parents(): array
    {
        if (!$this->_parent) {
            return array();
        }
        $nodes = $this->_parent->parents();
        $nodes[] = $this->_parent;
        return array_reverse($nodes);
    }
393063
public function rootNodes()
    {
        $query = $this->model->newQuery()->whereNull($this->parentIdKey);

        $this->callBeforeListeners('rootNodes', [$query]);

        $nodes = $query->get()->all();

        $this->callAfterListeners('rootNodes', [$nodes]);

        return $nodes;
    }
58417
public function get_children() {
        // If we should sort and it hasn't already been sorted.
        if ($this->sort && !$this->sorted) {
            if ($this->sortsplit) {
                $categories = array();
                $pages = array();
                foreach ($this->children as $child) {
                    if ($child instanceof admin_category) {
                        $categories[] = $child;
                    } else {
                        $pages[] = $child;
                    }
                }
                core_collator::asort_objects_by_property($categories, 'visiblename');
                core_collator::asort_objects_by_property($pages, 'visiblename');
                if (!$this->sortasc) {
                    $categories = array_reverse($categories);
                    $pages = array_reverse($pages);
                }
                $this->children = array_merge($pages, $categories);
            } else {
                core_collator::asort_objects_by_property($this->children, 'visiblename');
                if (!$this->sortasc) {
                    $this->children = array_reverse($this->children);
                }
            }
            $this->sorted = true;
        }
        return $this->children;
    }
1026785
public function getDescendants()
    {
        $descendants = [];

        $descendants[$this->name] = $this->appName;

        /** @var $child Node */
        foreach ($this->children as $child) {
            $childDescendats = $child->getDescendants();
            $descendants = array_merge($childDescendats, $descendants);
        }

        return $descendants;
    }
10025
private function get_childs()
    {
       $this->childs = new \PHPTools\PHPHtmlDom\Core\PHPHtmlDomList($this->dom_element->childNodes);

       return $this;
    }
14408
public function getIterator()
    {
        $iteration_result = array();
        if (\is_array($this->nodes)) {
            foreach ($this->nodes as $node) {
                $iteration_result[] = $this->createChildInstance($node);
            }
        }

        return new \ArrayIterator($iteration_result);
    }
1138628
public function getChildren()
    {
        $nodes = [];
        $iterator = new \FilesystemIterator(
            $this->path,
            \FilesystemIterator::CURRENT_AS_SELF
          | \FilesystemIterator::SKIP_DOTS
        );

        foreach ($iterator as $entry) {
            $nodes[] = $this->getChild($entry->getFilename());
        }

        return $nodes;
    }
782547
protected function getTokens()
    {
        if ($this->tokens === null) {
            $this->tokens = $this->parsePattern($this->pattern);
        }

        return $this->tokens;
    }
485540
public function getDescendants()
    {
        $descendants = [];
        if ($this->hasChildren()) {
            foreach ($this->getChildren() as $child) {
                $childDescendants = $child->hasChildren() ? $child->getDescendants() : [];
                $descendants = ArrayUtils::merge($descendants, ArrayUtils::merge([$child], $childDescendants));
            }
        }
        return $descendants;
    }
712642
public function getChildEdges()
    {
        $edges        = [];
        $hasChildren = false;

        foreach ($this->fields as $v) {
            if ($v instanceof GraphEdge) {
                $hasChildren = true;

                $children = $v->getChildEdges();
                foreach ($children as $childEdges) {
                    $edges[] = array_merge([$this->name], $childEdges);
                }
            }
        }

        // Means this is the final node (no further sub edges)
        if (!$hasChildren) {
            $edges[] = [$this->name];
        }

        return $edges;
    }
140415
public function collectChildren()
    {
        if ($this->hasChildrenRelation()) {
            $result = $this->getRelation($this->getChildrenRelationIndex());
        } else {
            $result = $this->children();
        }

        return $result;
    }
1244688
public function getTree()
    {
        $nodes = [];
        foreach ($this->nodes[$this->_config['rootid']]->getDescendants() as $subnode) {
            $nodes[] = $subnode;
        }
        return $nodes;
    }
279854
public function getChildren()
    {
        if ($this->disableListing) {
            throw new DAV\Exception\MethodNotAllowed('Listing members of this collection is disabled');
        }
        $children = [];
        foreach ($this->principalBackend->getPrincipalsByPrefix($this->principalPrefix) as $principalInfo) {
            $children[] = $this->getChildForPrincipal($principalInfo);
        }

        return $children;
    }
542717
protected function getChildNodeData()
    {
        return array_filter(
            $this->nodeDataRepository->findByParentWithoutReduce($this->path, $this->workspace),
            function ($childNodeData) {
                return $childNodeData->dimensionsHash === $this->dimensionsHash;
            }
        );
    }