#NEWLINE# def next_page( self ) : #NEWLINE# #INDENT# 'Fetch a single "page" of query results.\n\n        Low-level API for fine control:  the more convenient API is\n        to iterate on the current Iterator.\n\n        :rtype: tuple, (entities, more_results, cursor)\n        ' #NEWLINE# pb = _pb_from_query ( self . _query ) #NEWLINE# start_cursor = self . _start_cursor #NEWLINE# if ( start_cursor is not None ) : #NEWLINE# #INDENT# pb . start_cursor = base64 . urlsafe_b64decode ( start_cursor ) #NEWLINE# #UNINDENT# end_cursor = self . _end_cursor #NEWLINE# if ( end_cursor is not None ) : #NEWLINE# #INDENT# pb . end_cursor = base64 . urlsafe_b64decode ( end_cursor ) #NEWLINE# #UNINDENT# if ( self . _limit is not None ) : #NEWLINE# #INDENT# pb . limit . value = self . _limit #NEWLINE# #UNINDENT# pb . offset = self . _offset #NEWLINE# transaction = self . _client . current_transaction #NEWLINE# query_results = self . _client . connection . run_query ( query_pb = pb , project = self . _query . project , namespace = self . _query . namespace , transaction_id = ( transaction and transaction . id ) ) #NEWLINE# ( entity_pbs , cursor_as_bytes , more_results_enum ) = query_results [ : 3 ] #NEWLINE# if ( cursor_as_bytes == b'' ) : #NEWLINE# #INDENT# self . _start_cursor = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _start_cursor = base64 . urlsafe_b64encode ( cursor_as_bytes ) #NEWLINE# #UNINDENT# self . _end_cursor = None #NEWLINE# if ( more_results_enum == self . _NOT_FINISHED ) : #NEWLINE# #INDENT# self . _more_results = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( more_results_enum in self . _FINISHED ) : #NEWLINE# #INDENT# self . _more_results = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'Unexpected value returned for `more_results`.' ) #NEWLINE# #UNINDENT# #UNINDENT# self . _page = [ helpers . entity_from_protobuf ( entity ) for entity in entity_pbs ] #NEWLINE# return ( self . _page , self . _more_results , self . _start_cursor )