Returns fresh samples.
@param string|Builder $name
@param int            $count
@return object[]
963497
public function freshSamples($name, $count)
    {
        if ($name instanceof Builder) {
            return $this->getSampler()->samples($name, $count);
        }

        $builder = $this->getLinkManager()->retrieve($name);
        return $this->getSampler()->samples($builder, $count);
    }
678666
public function getRecords($limit = null, $name = null)
    {
        $modelName = $this->getModelName();

        $activity = $modelName::with('subject');

        if ( ! is_null($limit))
        {
            $activity->limit($limit);
        }

        if ($name)
        {
            if ( ! is_array($name))
            {
                $name = [$name];
            }

            $activity->whereIn('name', $name);
        }

        return $activity->latest()->get();
    }
1139216
public function getColumnsStartingWith($namePrefix)
    {
        $columnValues = array();
        foreach ($this->getRows() as $row) {
            $columns = $row->getColumns();
            foreach ($columns as $column => $value) {
                if (strpos($column, $namePrefix) === 0) {
                    $columnValues[] = $row->getColumn($column);
                }
            }
        }
        return $columnValues;
    }
1113763
public function getSingleTemplate(string $name): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/gitignore/templates/:name', $name));
    }
886367
public static function paragraphs($count = 3)
    {
        $paragraphs = array();
        for ($i = 0; $i < $count; $i++) {
            $paragraphs[] = static::paragraph();
        }

        return $paragraphs;
    }
425685
public function stream_read($count) {
    assert(isset($this->client));
    return $this->client->read($count);
  }
1102665
public static function getInstance( $name )
    {
        if (! isset( self::$instances[$name] ) )
            self::$instances[$name] = new self( $name );

        return self::$instances[$name];
    }
347420
public function iterNextPage($count = 3)
    {
        if ($this->getPage() == 1 && $this->getPagesCount() >= $count * 2) {
            $count *= 2;
        }
        $pages = [];
        foreach (range(1, $count) as $i) {
            $page = $this->getPage() + $i;
            if ($page <= $this->getPagesCount()) {
                $pages[] = $page;
            }
        }

        return $pages;
    }
470096
public function get( $name, $operation, $value)
    {

        $filterComponents = [];
        foreach( $this->reflPropertyMappers as $propertyMapper ) {
            $filterComponents[] = $this->getHelper( $propertyMapper, $name, $operation, $value );
        }

        // not a multi - just return the lone FindFilterComponent
        if( 1 === count($filterComponents) ) {
            return $filterComponents[0];
        }

        // is a multi - instantiate all the FindFilterComponents and build a FindFilterComponentMulti
        return new FindFilterComponentMulti(
            $filterComponents,
            $operation,
            $value
        );

    }
1358373
private function format($result, $count, $offset, $limit)
    {
        $nodes = [];
        foreach ($result as $item) {
            $resource = $this->getResource($item);
            $data = $this->getResourceData($resource);
            if ($data) {
                $nodes[] = $data;
            }
        }
        return [
            'total'  => $count,
            'offset' => $offset,
            'limit'  => $limit,
            'nodes'  => $nodes
        ];
    }
78584
static public function getPresets($name = self::FULL)
    {
        if ($presets = ArrayHelper::getValue(self::$presets, $name)) {
            return (array)$presets;
        }

        return [];
    }
165905
public function readFloats($count)
    {
        $floats = array();

        for ($i = 0; $i < $count; $i++) {
            $float = $this->readFloat();

            if (! is_nan($float)) {
                $floats[] = $float;
            }
        }

        return $floats;
    }
135561
public function getMetadataIntersectArray($name)
    {
        $data = array();
        foreach ($this->getDataTables() as $childTable) {
            $childData = $childTable->getMetadata($name);
            if (is_array($childData)) {
                $data = array_intersect($data, $childData);
            }
        }
        return array_values($data);
    }
1350606
public function getInjectedDefinitions($name)
    {
        $names = (array) $name;
        $visited = array();

        foreach ($names as $name) {
            $this->doGetInjectedDefinitions($name, $visited);
        }

        return $visited;
    }
857785
protected function getList($name)
    {
        if (null === ($list = $this->cache->get($name)) || !\is_array($list)) {
            return [];
        }

        return $list;
    }
1204884
protected function getListImageStyle($count = false)
    {
        $list = $this->image_style->getList();
        $allowed = $this->getAllowedFiltersImageStyle();

        $this->filterList($list, $allowed, $this->query_filter);
        $this->sortList($list, $allowed, $this->query_filter, array('name' => 'desc'));

        if ($count) {
            return count($list);
        }

        $this->limitList($list, $this->data_limit);
        $this->prepareListImageStyle($list);

        return $list;
    }
1181027
private function copyDefaultScope($name)
    {
        $result = null;
        if (isset($this->defaultScope[$name])) {
            $prefix = (!empty($this->as)) ? "{$this->as}." : "";
            if (!empty($prefix) && is_array($this->defaultScope[$name])) {
                $result = [];
                foreach ($this->defaultScope[$name] as $key => $val) {
                    $newKey = (is_string($key)) ? str_replace('@.', $prefix, $key) : $key;
                    $newVal = (is_string($val)) ? str_replace('@.', $prefix, $val) : $val;
                    $result[$newKey] = $newVal;
                }
            } else {
                $result = $this->defaultScope[$name];
            }
        }

        return $result;
    }