Chunk the results of the query

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

        :return: The current chunk
        :rtype: list
16916
def chunk(self, count):
        
        for chunk in self._connection.select_many(
            count, self.to_sql(), self.get_bindings(), not self._use_write_connection
        ):
            yield chunk
1304554
def count(self, q):
        
        q = "SELECT COUNT(*) %s"%q
        return int(self.quick(q).split("\n")[1])
1299653
def deleted_count(self):
        """"""
        if isinstance(self.raw_result, list):
            return len(self.raw_result)
        else:
            return self.raw_result
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)
1231583
def chunk_count(self):
        """"""
        c = 0
        for r in self.iter_regions():
            c += r.chunk_count()
        return c
138936
def count_results(cube, q):
    
    q = select(columns=[func.count(True)], from_obj=q.alias())
    return cube.engine.execute(q).scalar()
1257199
def get_count(self, query):
        
        count_q = query.statement.with_only_columns(
            [func.count()]).order_by(None)
        count = query.session.execute(count_q).scalar()
        return count
1188706
def count(self):
        '''
        
        '''
        args = self.format_args
        if args is None or \
                (isinstance(args, dict) and self.count_field not in args):
            raise TypeError("count is required")
        return args[self.count_field] if isinstance(args, dict) else args
864684
def count(self):
        
        if hasattr(self, '_response'):
            return self._response.hits.total

        es = connections.get_connection(self._using)

        d = self.to_dict(count=True)
        # TODO: failed shards detection
        return es.count(
            index=self._index,
            body=d,
            **self._params
        )['count']
1186822
def count(self):
        """"""

        # count queries shouldn't care about sorting
        fields_sort = self.fields_sort
        self.fields_sort = self.fields_sort_class()

        self.default_val = 0
        ret = self._query('count')

        # restore previous values now that count is done
        self.fields_sort = fields_sort

        return ret
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
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,
        )
1033631
def list(self, count=10):
    
    import IPython
    data = []
    # Add range(count) to loop so it will stop either it reaches count, or iteration
    # on self is exhausted. "self" is iterable (see __iter__() method).
    for _, model in zip(range(count), self.get_iterator()):
      element = {'name': model['name']}
      if 'defaultVersion' in model:
        version_short_name = model['defaultVersion']['name'].split('/')[-1]
        element['defaultVersion'] = version_short_name
      data.append(element)

    IPython.display.display(
        datalab.utils.commands.render_dictionary(data, ['name', 'defaultVersion']))
621265
def chunked_list(_list, _chunk_size=50):
    
    for i in range(0, len(_list), _chunk_size):
        yield _list[i:i + _chunk_size]
46476
def count(self):
        
        return self.mapPartitions(lambda i: [sum(1 for _ in i)]).reduce(operator.add)
706182
def get_count_query(self):
        
        query_copy = self.copy()
        if not query_copy.tables:
            raise Exception('No tables specified to do a count')

        for table in query_copy.tables:
            del table.fields[:]

        query_copy.tables[0].add_field(CountField('*'))
        del query_copy.sorters[:]
        return query_copy
938416
def sparql_count(self, query, flush=None):
        
        return self.count_statements(query, language='sparql', type='tuples',
            flush=flush)