#NEWLINE# def PopulateQueryResult( self , count , offset , result ) : #NEWLINE# #INDENT# 'Populates a QueryResult PB with results from the cursor.\n\n    Args:\n      count: The number of results to retrieve.\n      offset: The number of results to skip.\n      result: out: A query_result PB.\n    ' #NEWLINE# result . set_skipped_results ( min ( count , offset ) ) #NEWLINE# result_list = result . result_list ( ) #NEWLINE# if self . __results : #NEWLINE# #INDENT# if self . __query . keys_only ( ) : #NEWLINE# #INDENT# for entity in self . __results : #NEWLINE# #INDENT# entity . clear_property ( ) #NEWLINE# entity . clear_raw_property ( ) #NEWLINE# result_list . append ( entity ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# result_list . extend ( self . __results ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# result_list = [ ] #NEWLINE# #UNINDENT# result . set_keys_only ( self . __query . keys_only ( ) ) #NEWLINE# result . set_more_results ( ( offset < count ) ) #NEWLINE# if ( self . __results or self . __last_ent ) : #NEWLINE# #INDENT# self . _EncodeCompiledCursor ( result . mutable_compiled_cursor ( ) )