#NEWLINE# @ classmethod #NEWLINE# def hydrate( cls , data , inst = None ) : #NEWLINE# #INDENT# self = data [ 'self' ] #NEWLINE# if ( inst is None ) : #NEWLINE# #INDENT# new_inst = cls ( ) #NEWLINE# new_inst . __stale . update ( { 'labels' , 'properties' } ) #NEWLINE# inst = cls . cache . setdefault ( self , new_inst ) #NEWLINE# if ( inst is None ) : #NEWLINE# #INDENT# inst = cls . cache [ self ] = new_inst #NEWLINE# #UNINDENT# #UNINDENT# cls . cache [ self ] = inst #NEWLINE# inst . __remote__ = RemoteEntity ( self , data ) #NEWLINE# if ( 'data' in data ) : #NEWLINE# #INDENT# inst . __stale . discard ( 'properties' ) #NEWLINE# inst . clear ( ) #NEWLINE# inst . update ( data [ 'data' ] ) #NEWLINE# #UNINDENT# if ( 'metadata' in data ) : #NEWLINE# #INDENT# inst . __stale . discard ( 'labels' ) #NEWLINE# metadata = data [ 'metadata' ] #NEWLINE# inst . clear_labels ( ) #NEWLINE# inst . update_labels ( metadata [ 'labels' ] ) #NEWLINE# #UNINDENT# return inst