Chunk the results of the query

        :param count: The chunk size
        :type count: int

        :return: The current chunk
        :rtype: list
180412
def chunk(self, count):
        
        page = 1
        results = self.for_page(page, count).get()

        while results:
            yield results

            page += 1

            results = self.for_page(page, count).get()
120843
async def read_chunk(self, size: int=chunk_size) -> bytes:
        
        if self._at_eof:
            return b''
        if self._length:
            chunk = await self._read_chunk_from_length(size)
        else:
            chunk = await self._read_chunk_from_stream(size)

        self._read_bytes += len(chunk)
        if self._read_bytes == self._length:
            self._at_eof = True
        if self._at_eof:
            newline = await self._content.readline()
            assert newline == self._newline, \
                'reader did not read all the data or it is malformed'
        return chunk
1329382
def last(self, count=1):
        
        if self._order_with:
            order = self._order_with.values()[0]
            order = "desc" if order == "asc" else "asc"
            order_with = self._order_with
            self._order_with = {}
            result = self.order_by(**{order_with.keys()[0]: order}).first(count)
            self._order_with = order_with
            return result
        else:
            return self.order_by(id="desc").first(count)
390386
def count(self, request, *args, **kwargs):
        

        self.queryset = self.filter_queryset(self.get_queryset())
        return response.Response({'count': self.queryset.count()}, status=status.HTTP_200_OK)
310144
def process_chunks(self, documents, operation):
        
        chunk_size = self.chunk_size
        start = end = 0
        count = len(documents)

        while count:
            if count < chunk_size:
                chunk_size = count
            end += chunk_size

            bulk = documents[start:end]
            operation(documents_actions=bulk)

            start += chunk_size
            count -= chunk_size
101821
def read(self, size=None):
        
        if size is None or size < 0:
            return "".join(list(self))
        else:
            data_chunks = []
            data_readed = 0
            try:
                while data_readed < size:
                    chunk = self.next_chunk()
                    data_chunks.append(chunk)
                    data_readed += len(chunk)
            except StopIteration:
                pass

            if data_readed > size:
                last_chunk = data_chunks.pop()
                extra_length = data_readed - size
                last_chunk, extra_data = last_chunk[:-extra_length], last_chunk[-extra_length:]
                self.unshift(extra_data)
                data_chunks.append(last_chunk)
            return "".join(data_chunks)
835546
def _chunk(self, size):
        
        items = self.items

        return [items[i:i + size] for i in range(0, len(items), size)]
790128
def size(self):
    
    if self._size is None:
      self._size = bq.Query('SELECT COUNT(*) FROM %s' %
                            self._get_source()).execute().result()[0].values()[0]
    return self._size
558011
def count(self):
        
        if self._batch:
            raise CQLEngineException("Only inserts, updates, and deletes are available in batch mode")

        if self._result_cache is None:
            query = self._select_query()
            query.count = True
            result = self._execute(query)
            return result[0]['count']
        else:
            return len(self._result_cache)
1025853
def get_chunk(self, size=None):
        
        if size is None:
            size = self._chunksize
        return self.read(nrows=size)
927844
function count(query, callback) {
    self.emit('count', query)
    findByQuery(query, options, function (error, objects) {
      self.emit('received', objects.length)
      callback(undefined, objects.length)
    })
  }
152572
def chunk(self, count):
        
        connection = self._model.get_connection_name()
        for results in self.apply_scopes().get_query().chunk(count):
            models = self._model.hydrate(results, connection)

            # If we actually found models we will also eager load any relationships that
            # have been specified as needing to be eager loaded, which will solve the
            # n+1 query issue for the developers to avoid running a lot of queries.
            if len(models) > 0:
                models = self.eager_load_relations(models)

            collection = self._model.new_collection(models)

            yield collection
761706
def multiple_chunks(self, chunk_size=None):
        
        if not chunk_size:
            chunk_size = self.DEFAULT_CHUNK_SIZE
        return self.size > chunk_size
440333
def count(self) -> "CountQuery":
        
        return CountQuery(
            db=self._db,
            model=self.model,
            q_objects=self._q_objects,
            annotations=self._annotations,
            custom_filters=self._custom_filters,
        )
3202
def chunk(self, size=0):
        

        if size == 0:
            raise ValueError('Invalid chunk size')

        self.__prepare()
        _new_content = []

        while(len(self._json_data) > 0):
            _new_content.append(self._json_data[0:size])
            self._json_data = self._json_data[size:]

        self._json_data = _new_content

        return self._json_data
1119279
def skip(self, count):
        '''
        
        '''
        self._initialize()
        skipped = 0
        if not self._exhausted():
            skipped = min(count, self._last_index() - self._current_index)
            self._current_index += skipped
        return skipped
789033
def count(self, cls, filters, quick=True, sort_by=None, select=None):
        
        query = "select count(*) from `%s` %s" % (self.domain.name, self._build_filter_part(cls, filters, sort_by, select))
        count = 0
        for row in self.domain.select(query):
            count += int(row['Count'])
            if quick:
                return count
        return count