#NEWLINE# @ classmethod #NEWLINE# def get_by_instance( cls , context , instance ) : #NEWLINE# #INDENT# if ( 'pci_requests' in instance [ 'system_metadata' ] ) : #NEWLINE# #INDENT# sysmeta = instance [ 'system_metadata' ] #NEWLINE# _requests = ( cls . _load_legacy_requests ( sysmeta [ 'pci_requests' ] ) + cls . _load_legacy_requests ( sysmeta . get ( 'new_pci_requests' ) , is_new = True ) ) #NEWLINE# requests = cls ( instance_uuid = instance [ 'uuid' ] , requests = _requests ) #NEWLINE# requests . obj_reset_changes ( ) #NEWLINE# return requests #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return cls . get_by_instance_uuid ( context , cls [ 'uuid' ] )