labpack/databases/google/datastore.py
def _paginate(self, query, iter_func, end_func):

        ''' a method to automatically paginate fetch queries '''

        next_cursor = True
        kwargs = {
            'limit': 100
        }
        count = 0
        while next_cursor:
            query_iter = query.fetch(**kwargs)
            page = next(query_iter.pages)
            for entity in page:
                iter_func(entity)
                count += 1
            next_cursor = query_iter.next_page_token
            if next_cursor:
                kwargs['start_cursor'] = next_cursor

        return end_func(count)
 a method to automatically paginate fetch queries 
a method to automatically paginate fetch queries
a method to automatically paginate fetch queries
def _paginate(self, query, iter_func, end_func):
        next_cursor = True
        kwargs = {
            'limit': 100
        }
        count = 0
        while next_cursor:
            query_iter = query.fetch(**kwargs)
            page = next(query_iter.pages)
            for entity in page:
                iter_func(entity)
                count += 1
            next_cursor = query_iter.next_page_token
            if next_cursor:
                kwargs['start_cursor'] = next_cursor
        return end_func(count)
def _paginate ( self , query , iter_func , end_func ) : next_cursor = True kwargs = { 'limit' : 100 } count = 0 while next_cursor : query_iter = query . fetch ( ** kwargs ) page = next ( query_iter . pages ) for entity in page : iter_func ( entity ) count += 1 next_cursor = query_iter . next_page_token if next_cursor : kwargs [ 'start_cursor' ] = next_cursor return end_func ( count )
a method to automatically paginate fetch queries
a method to automatically paginate fetch queries
''' a method to automatically paginate fetch queries '''
self
query
iter_func
end_func