#NEWLINE# def _GetRows( self , result ) : #NEWLINE# #INDENT# 'Returns a sequence of sequences containing the result set.\n\n    Args:\n      result: The client_pb2.ResultProto to process.\n\n    Returns:\n      A sequence of sequences, or an empty sequence when result set is empty.\n      Returns None if result set is not present.\n    ' #NEWLINE# if ( not result . rows . tuples ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# assert self . _description , 'Column descriptions do not exist.' #NEWLINE# column_names = [ col [ 0 ] for col in self . _description ] #NEWLINE# rows = [ ] #NEWLINE# for tuple_proto in result . rows . tuples : #NEWLINE# #INDENT# row = [ ] #NEWLINE# nulls = set ( tuple_proto . nulls ) #NEWLINE# value_index = 0 #NEWLINE# for ( i , column_descr ) in enumerate ( self . _description ) : #NEWLINE# #INDENT# if ( i in nulls ) : #NEWLINE# #INDENT# row . append ( None ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# row . append ( self . _DecodeVariable ( column_descr [ 1 ] , tuple_proto . values [ value_index ] ) ) #NEWLINE# value_index += 1 #NEWLINE# #UNINDENT# #UNINDENT# if self . _use_dict_cursor : #NEWLINE# #INDENT# assert ( len ( column_names ) == len ( row ) ) #NEWLINE# row = dict ( zip ( column_names , row ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# row = tuple ( row ) #NEWLINE# #UNINDENT# rows . append ( row ) #NEWLINE# #UNINDENT# return rows