Fetch the items from raw or enriched index. An optional _filter
        could be provided to filter the data collected
434819
def fetch(self, _filter=None, ignore_incremental=False):
        

        logger.debug("Creating a elastic items generator.")

        scroll_id = None
        page = self.get_elastic_items(scroll_id, _filter=_filter, ignore_incremental=ignore_incremental)

        if not page:
            return []

        scroll_id = page["_scroll_id"]
        scroll_size = page['hits']['total']

        if scroll_size == 0:
            logger.warning("No results found from %s", self.elastic.anonymize_url(self.elastic.index_url))
            return

        while scroll_size > 0:

            logger.debug("Fetching from %s: %d received", self.elastic.anonymize_url(self.elastic.index_url),
                         len(page['hits']['hits']))
            for item in page['hits']['hits']:
                eitem = item['_source']
                yield eitem

            page = self.get_elastic_items(scroll_id, _filter=_filter, ignore_incremental=ignore_incremental)

            if not page:
                break

            scroll_size = len(page['hits']['hits'])

        logger.debug("Fetching from %s: done receiving", self.elastic.anonymize_url(self.elastic.index_url))
581009
def fetch(self):
        
        returnResults = []

        results = self._query.run()
        for result in results:
            if self._join:
                # Because we can tell the models to ignore certian fields,
                # through the protectedItems blacklist, we can nest models by
                # name and have each one act normal and not accidentally store
                # extra data from other models
                item = self._model.fromRawEntry(**result["left"])
                joined = self._join.fromRawEntry(**result["right"])
                item.protectedItems = self._joinedField
                item[self._joinedField] = joined

            else:
                item = self._model.fromRawEntry(**result)

            returnResults.append(item)

        self._documents = returnResults
        return self._documents
157661
def fetch(reload = false, query_params = {})
      return if expanded? && !reload
      response = client.get(url_with_query_params(url, query_params))
      set_attrs_from_response(response)
      @expanded = true
    end
1016005
def filtered_search(self,
               id_list: Iterable,
               negated_classes: Iterable,
               limit: Optional[int],
               taxon_filter: Optional,
               category_filter: Optional,
               method: Optional) -> SimResult:
        
        pass
1055541
def _base_get_list(self, url, limit=None, *, query=None, order_by=None,
                       batch=None):
        

        if limit is None or limit > self.protocol.max_top_value:
            batch = self.protocol.max_top_value

        params = {'$top': batch if batch else limit}

        if order_by:
            params['$orderby'] = order_by

        if query:
            if query.has_filters:
                warnings.warn(
                    'Filters are not allowed by the Api Provider '
                    'in this method')
                query.clear_filters()
            if isinstance(query, str):
                params['$filter'] = query
            else:
                params.update(query.as_params())

        response = self.con.get(url, params=params)
        if not response:
            return iter(())

        data = response.json()

        # Everything received from cloud must be passed as self._cloud_data_key
        items = (
            self._classifier(item)(parent=self, **{self._cloud_data_key: item})
            for item in data.get('value', []))
        next_link = data.get(NEXT_LINK_KEYWORD, None)
        if batch and next_link:
            return Pagination(parent=self, data=items,
                              constructor=self._classifier,
                              next_link=next_link, limit=limit)
        else:
            return items
1373827
def fetchByExample(self, exampleDict, batchSize, rawResults = False, **queryArgs) :
        """"""
        return self.simpleQuery('by-example', rawResults, example = exampleDict, batchSize = batchSize, **queryArgs)
830973
def get_by_index(self, index):
        
        if index >= len(self._datasets):
            raise DataInvalidIndex('A dataset with index {} does not exist'.format(index))

        return self._datasets[index]
212448
def fetch_items(self):
        
        offset = self.per_page * (self.page - 1)
        items = self._query.limit(self.per_page).offset(offset).all()
        return items
150984
def parse_filter_params(query_params, filterable):
    
    if query_params is not None:
        filter_params = {}
        for fq in query_params.mixed():
            if fq in filterable:
                filter_params[fq] = query_params.mixed().get(fq)
        return filter_params
    else:
        return {}
1200204
def fetch_by_id(model, id, filters = {})
      get_resource("/v1/public/#{model}/#{id}", filters) if model_exists?(model) && validate_filters(filters)
    end
1101364
function () {
    var items = [];
    for (var i = 0, length = this.getFilteredItemCount(); i < length; i++) {
      items.push(this.items[this.convertViewIndexToModel(i)]);
    }
    return items;
  }
710284
def get_objects(self):
        
        # Create a mapping of source ARs for copy
        uids = self.request.form.get("uids", "")
        if not uids:
            # check for the `items` parammeter
            uids = self.request.form.get("items", "")
        if isinstance(uids, basestring):
            uids = uids.split(",")
        unique_uids = OrderedDict().fromkeys(uids).keys()
        return filter(None, map(self.get_object_by_uid, unique_uids))
329277
def find(self, query=None, limit=None):
        
        results = []
        query = query or {}

        # TODO: When indexes are implemented, we'll need to intelligently hit one of the
        # index stores so we don't do a full table scan
        cursor = self.db.execute("select id, data from %s" % self.name)
        apply = partial(self._apply_query, query)

        for match in filter(apply, starmap(self._load, cursor.fetchall())):
            results.append(match)

            # Just return if we already reached the limit
            if limit and len(results) == limit:
                return results

        return results
126026
def get_elements(self, filter_cls, elem_id=None):
        
        result = []
        if elem_id is not None:
            try:
                result = [self._class_collection_map[filter_cls][elem_id]]
            except KeyError:
                result = []
        else:
            for e in self._class_collection_map[filter_cls].values():
                result.append(e)
        return result
885721
def fetch_all(self, org):
        
        qs = self.model.objects.filter(org=org)
        if self.local_backend_attr is not None:
            qs = qs.filter(**{self.local_backend_attr: self.backend})
        return qs
736917
def item(self, index: int) -> Optional[Attr]:
        """"""
        if 0 <= index < len(self):
            return self._dict[tuple(self._dict.keys())[index]]
        return None
824375
def filter(self, table, items, filter_string):
        """"""
        query = filter_string.lower()
        return [item for item in items
                if query in item.name.lower()]