def retrieve_next_page(key, seed, args, callback, initial_bookmark=None):
 filter = dict(args)
 if ('pager_info' in filter):
  initial_bookmark = decrypt(filter.pop('pager_info'), key, seed)
 page_size = filter.pop('page_size', DEFAULT_PAGE_SIZE)
 (result_list, new_bookmark, approx_result_size) = callback(filter, initial_bookmark, page_size)
 filter['pager_info'] = encrypt(new_bookmark, key, seed)
 filter['page_size'] = page_size
 return (result_list, filter, approx_result_size)

def retrieve_next_page ( key , seed , args , callback , initial_bookmark = None ) : filter = dict ( args ) if ( 'pager_info' in filter ) : initial_bookmark = decrypt ( filter . pop ( 'pager_info' ) , key , seed ) page_size = filter . pop ( 'page_size' , DEFAULT_PAGE_SIZE ) ( result_list , new_bookmark , approx_result_size ) = callback ( filter , initial_bookmark , page_size ) filter [ 'pager_info' ] = encrypt ( new_bookmark , key , seed ) filter [ 'page_size' ] = page_size return ( result_list , filter , approx_result_size )
a helper for the bookmark pager .