Returns an array of Sampling Nodes.
@access		public
@return		array
507503
public function getSamplingNodes()
	{
		$nodes	= array();
		$start	= $this->interval->getStart();
		$distance	= $this->getNodeDistance();
		for( $i = 0; $i<$this->getNodes(); $i++ )
		{
			$x = $start + $i * $distance;
			$nodes[] = $x;
		}
		return $nodes;
	}
388709
private function getNodes(): array
    {
        return [
            new ConfigurationNode\ViewNode(),
            new ConfigurationNode\DesignNode(),
            new ConfigurationNode\DesignListNode(),
            new ConfigurationNode\DefaultViewTemplatesNode(),
            new ConfigurationNode\HttpCacheNode(),
            new ConfigurationNode\BlockDefinitionNode(),
            new ConfigurationNode\BlockTypeNode(),
            new ConfigurationNode\BlockTypeGroupNode(),
            new ConfigurationNode\LayoutTypeNode(),
            new ConfigurationNode\QueryTypeNode(),
            new ConfigurationNode\PageLayoutNode(),
            new ConfigurationNode\ApiKeysNode(),
            new ConfigurationNode\ValueTypeNode(),
            new ConfigurationNode\DebugNode(),
        ];
    }
1030655
public function findReferencedNodes(): TraversableNodes
    {
        $referencedNodes = [];
        foreach ($this->getNodeType()->getProperties() as $propertyName => $property) {
            $propertyType = $this->getNodeType()->getPropertyType($propertyName);
            if ($propertyType === 'reference' && $this->getProperty($propertyName) instanceof TraversableNodeInterface) {
                $referencedNodes[] = $this->getProperty($propertyName);
            } elseif ($propertyName === 'references' && !empty($this->getProperty($propertyName))) {
                foreach ($this->getProperty($propertyName) as $node) {
                    if ($node instanceof TraversableNodeInterface) {
                        $referencedNodes[] = $node;
                    }
                }
            }
        }

        return TraversableNodes::fromArray($referencedNodes);
    }
224425
public function getNodeNames()
    {
        $data = $this->getState();
        $nodeNames = [];
        foreach ($data['nodes'] as $node) {
            $nodeNames[] = $node['name'];
        }

        return $nodeNames;
    }
182868
public function getFeatureImportances()
    {
        if ($this->featureImportances !== null) {
            return $this->featureImportances;
        }

        $sampleCount = count($this->samples);
        $this->featureImportances = [];
        foreach ($this->columnNames as $column => $columnName) {
            $nodes = $this->getSplitNodesByColumn($column, $this->tree);

            $importance = 0;
            foreach ($nodes as $node) {
                $importance += $node->getNodeImpurityDecrease($sampleCount);
            }

            $this->featureImportances[$columnName] = $importance;
        }

        // Normalize & sort the importances
        $total = array_sum($this->featureImportances);
        if ($total > 0) {
            foreach ($this->featureImportances as &$importance) {
                $importance /= $total;
            }
            arsort($this->featureImportances);
        }

        return $this->featureImportances;
    }
17160
protected function getSections(): array
    {
        $sections = explode($this->getDivider(), $this->getNotation());
        foreach ($sections as $index => $section) {
            $sections[$index] = explode($this->getSeparator(), $section);
        }

        return $sections;
    }
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;
            }
        }
    }
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;
    }
414961
private function getSections() {
		$sections = array();
		foreach (Craft::$app->getSections()->getEditableSections() as $section) {
			$sections[$section->id] = Craft::t('site', $section->name);
		}
		return $sections;
	}
54349
private function createDefaultOptionNodes()
    {
        $nodes = array();

        foreach ($this->defaults as $key => $value) {
            // Only scalars are allowed, the rest is ignored
            if (is_scalar($value)) {
                array_push($nodes, $this->createOptionNode($key, $value));
            }
        }

        return $nodes;
    }
679731
protected function resample(): array
    {
        $weights = $this->weights;
        $std = StandardDeviation::population($weights);
        $mean = Mean::arithmetic($weights);
        $min = min($weights);
        $minZ = (int) round(($min - $mean) / $std);

        $samples = [];
        $targets = [];
        foreach ($weights as $index => $weight) {
            $z = (int) round(($weight - $mean) / $std) - $minZ + 1;
            for ($i = 0; $i < $z; ++$i) {
                if (random_int(0, 1) == 0) {
                    continue;
                }

                $samples[] = $this->samples[$index];
                $targets[] = $this->targets[$index];
            }
        }

        return [$samples, $targets];
    }
356163
protected function getRootTreeData()
    {
        return [
            'id' => '0',
            'parent' => '#',
            'text' => $this->treeLabels['top_level_tags'],
            'children' => true,
            'state' => [
                'opened' => true,
            ],
            'a_attr' => [
                'href' => $this->treeLinks['top_level_tags'],
                'rel' => '0',
            ],
            'data' => [
                'context_menu' => [
                    [
                        'name' => 'add_child',
                        'url' => str_replace(':parentId', 0, $this->treeLinks['add_child']),
                        'text' => $this->treeLabels['add_child'],
                    ],
                ],
            ],
        ];
    }
986926
public function getChildren()
    {
        $nodes = [];
        try {
            $child = $this->firstChild();
            do {
                $nodes[] = $child;
                $child   = $this->nextChild($child->id());
            } while ( ! is_null($child));
        } catch (ChildNotFoundException $e) {
            // we are done looking for children
        }

        return $nodes;
    }
189040
private function findClasses()
    {
        $classes       = array();
        $namespaceName = $this->getName();
        // classes can be only top-level nodes in the namespace, so we can scan them directly
        foreach ($this->namespaceNode->stmts as $namespaceLevelNode) {
            if ($namespaceLevelNode instanceof ClassLike) {
                $classShortName = $namespaceLevelNode->name->toString();
                $className = $namespaceName ? $namespaceName .'\\' . $classShortName : $classShortName;

                $namespaceLevelNode->setAttribute('fileName', $this->fileName);
                $classes[$className] = new ReflectionClass($className, $namespaceLevelNode);
            }
        }

        return $classes;
    }
1104265
public function getAllNodeIdentifiers()
    {
        $ret = [];

        if ($this->isSuccessful) {
            foreach ($this->rawResponse['hits']['hits'] as $document) {
                $ret[] = $document['_id'];
            }
        }

        return $ret;
    }
841096
public function getRequestedNodes()
    {
        $dh = $this->getSitemapDataProvider();
        $cParentID = 0;
        $parent = null;
        if ($this->request->query->has('cParentID')) {
            $cParentID = $this->request->query->get('cParentID');
        }
        if ($cParentID > 0) {
            $c = \Page::getByID($cParentID);
            $parent = \Page::getByID($c->getCollectionParentID());
        }

        if (is_object($parent) && !$parent->isError()) {
            $n = $dh->getNode($parent->getCollectionID());
            $n->icon = 'fa fa-angle-double-up';
            $n->expanded = true;
            $n->displaySingleLevel = true;

            $p = $dh->getNode($this->request->query->get('cParentID'));
            $p->expanded = true;
            $p->children = $dh->getSubNodes($this->request->query->get('cParentID'));
            $n->children = [$p];
            $nodes[] = $n;
        } else {
            if ($cParentID > 0) {
                $n = $dh->getNode($cParentID);
                $n->children = $dh->getSubNodes($this->request->query->get('cParentID'));
                $nodes[] = $n;
            } else {
                $nodes = $dh->getSubNodes($this->getRequestedSiteTree());
            }
        }

        return $nodes;
    }
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;
    }