#NEWLINE# def load( self , data ) : #NEWLINE# #INDENT# assert ( not self . loaded ) #NEWLINE# try : #NEWLINE# #INDENT# entities = self . transaction . entities . popleft ( ) #NEWLINE# #UNINDENT# except ( AttributeError , IndexError ) : #NEWLINE# #INDENT# entities = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# self . _keys = keys = tuple ( data [ 'columns' ] ) #NEWLINE# hydrate = self . graph . _hydrate #NEWLINE# for record in data [ 'data' ] : #NEWLINE# #INDENT# values = [ ] #NEWLINE# for ( i , value ) in enumerate ( record [ 'rest' ] ) : #NEWLINE# #INDENT# key = keys [ i ] #NEWLINE# cached = entities . get ( key ) #NEWLINE# values . append ( hydrate ( value , inst = cached ) ) #NEWLINE# #UNINDENT# self . buffer . append ( Record ( keys , values ) ) #NEWLINE# #UNINDENT# self . loaded = True