#NEWLINE# def to_dict( self ) : #NEWLINE# #INDENT# '\n        Convert the Batch object into the format required for Layer1.\n        ' #NEWLINE# batch_dict = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# key_list = [ ] #NEWLINE# for key in self . keys : #NEWLINE# #INDENT# if isinstance ( key , tuple ) : #NEWLINE# #INDENT# ( hash_key , range_key ) = k #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# hash_key = key #NEWLINE# range_key = None #NEWLINE# #UNINDENT# k = self . table . layer2 . build_key_from_values ( self . table . schema , hash_key , range_key ) #NEWLINE# key_list . append ( k ) #NEWLINE# #UNINDENT# batch_dict [ 'Keys' ] = key_list #NEWLINE# if self . attributes_to_get : #NEWLINE# #INDENT# batch_dict [ 'AttributesToGet' ] = self . attributes_to_get #NEWLINE# #UNINDENT# return batch_dict