Includes results built from all block collections, if specified so.
333376
public function onBuildView(CollectViewParametersEvent $event): void
    {
        $view = $event->getView();

        if (!$view instanceof BlockViewInterface) {
            return;
        }

        if (!in_array($view->getContext(), $this->enabledContexts, true)) {
            return;
        }

        $this->dataCollector->collectBlockView($view);
    }
820492
def _build_block_context(template, context):
    """"""

    # Ensure there's a BlockContext before rendering. This allows blocks in
    # ExtendsNodes to be found by sub-templates (allowing {{ block.super }} and
    # overriding sub-blocks to work).
    if BLOCK_CONTEXT_KEY not in context.render_context:
        context.render_context[BLOCK_CONTEXT_KEY] = BlockContext()
    block_context = context.render_context[BLOCK_CONTEXT_KEY]

    for node in template.nodelist:
        if isinstance(node, ExtendsNode):
            compiled_parent = node.get_parent(context)

            # Add the parent node's blocks to the context. (This ends up being
            # similar logic to ExtendsNode.render(), where we're adding the
            # parent's blocks to the context so a child can find them.)
            block_context.add_blocks(
                {n.name: n for n in compiled_parent.nodelist.get_nodes_by_type(BlockNode)})

            _build_block_context(compiled_parent, context)
            return compiled_parent

        # The ExtendsNode has to be the first non-text node.
        if not isinstance(node, TextNode):
            break
1358839
def all(self):
        
        results = self.data[self.data_type]
        while self.current < self.total:
            self.fetch_next_page()
            results.extend(self.data[self.data_type])
        return results
1020738
public static List<CollectionResult<?>> getCollectionResults(Result r) {
    if(r instanceof CollectionResult<?>) {
      List<CollectionResult<?>> crs = new ArrayList<>(1);
      crs.add((CollectionResult<?>) r);
      return crs;
    }
    if(r instanceof HierarchicalResult) {
      return filterResults(((HierarchicalResult) r).getHierarchy(), r, CollectionResult.class);
    }
    return Collections.emptyList();
  }
1338418
def load_results(result_files, options, run_set_id=None, columns=None,
                 columns_relevant_for_diff=set()):
    """"""
    return parallel.map(
        load_result,
        result_files,
        itertools.repeat(options),
        itertools.repeat(run_set_id),
        itertools.repeat(columns),
        itertools.repeat(columns_relevant_for_diff))
1136201
def each
      return to_enum unless block_given?
      super do |resource|
        begin
          original, resource.collection = resource.collection, self
          yield resource
        ensure
          resource.collection = original
        end
      end
    end
747461
def is_get_query_with_results(results):
        
        return results and EsConst.FOUND in results and results[EsConst.FOUND] and EsConst.FIELDS in results
728285
function collectionResultList (context, results) {
    // apply views to each result
    return Promise.each(results, (raw, num) => {
        // get result
        return this.applyModelViewCollection(context, num, raw)
        // merge result to context
        .then(ctx => {
            _.merge(context, ctx)
        })
    })
    // resolve with context
    .then(() => context)
}
79938
def _wrap_results(self, results, blocks, obj):
        

        from pandas import Series, concat
        from pandas.core.index import ensure_index

        final = []
        for result, block in zip(results, blocks):

            result = self._wrap_result(result, block=block, obj=obj)
            if result.ndim == 1:
                return result
            final.append(result)

        # if we have an 'on' column
        # we want to put it back into the results
        # in the same location
        columns = self._selected_obj.columns
        if self.on is not None and not self._on.equals(obj.index):

            name = self._on.name
            final.append(Series(self._on, index=obj.index, name=name))

            if self._selection is not None:

                selection = ensure_index(self._selection)

                # need to reorder to include original location of
                # the on column (if its not already there)
                if name not in selection:
                    columns = self.obj.columns
                    indexer = columns.get_indexer(selection.tolist() + [name])
                    columns = columns.take(sorted(indexer))

        if not len(final):
            return obj.astype('float64')
        return concat(final, axis=1).reindex(columns=columns, copy=False)
1064387
def _all(self, query):
        """"""
        if query.count() > 0:
            results = query.all()
            for result in results:
                if result.has_expired(self._expirations):
                    raise NotFoundError
            return results
        else:
            raise NotFoundError
230758
private function filterActiveBlocks(Collection $blocks, Collection $active_blocks): Collection
    {
        return $blocks->map(static function (string $block_name) use ($active_blocks): ?ModuleBlockInterface {
            return $active_blocks->filter(static function (ModuleInterface $block) use ($block_name): bool {
                return $block->name() === $block_name;
            })->first();
        })->filter();
    }
1280496
def each(&block)
      @results ||= get(Nominatim.config.search_url, @criteria).body.map! { |attrs| Nominatim::Place.new(attrs) }
      @results.each(&block)
    end
625195
def add(self, new_results):
        
        for result in new_results:
            result.update(self.context)
            self.results = self.results.append(result, ignore_index=True)
156059
public function get_installed_blocks() {
        global $DB;
        if (is_null($this->allblocks)) {
            $this->allblocks = $DB->get_records('block');
        }
        return $this->allblocks;
    }
715321
protected function fetchBlocks()
    {
        if (null === $this->blocks)
        {
            $this->blocks = array();

            $allBlocks = ContentBlockQuery::create()
                ->find()
            ;

            foreach ($allBlocks as $block)
            {
                /* @var $block ContentBlock */
                $this->blocks[$block->getName()][$block->getLocale()] = $block;
            }
        }
    }
485368
function collectionResultIterator (context, results) {
    // create new result object
    var result = new ImmutableCoreModelResult({
        query: this.query,
        results: results,
    })
    // execute iterator
    return result.each((record, num) => {
        // get result
        return this.applyModelViewCollection(context, num, record.raw)
        // merge result to context
        .then(ctx => {
            _.merge(context, ctx)
        })
    })
    // resolve with context
    .then(() => context)
}
1243781
def get_all_if_set(self):
        

        with self._lock:
            results = {}
            for add, fut in self._state.items():
                if self._contains_and_set(add):
                    results[add] = fut.result()
            return results