#NEWLINE# @ classmethod #NEWLINE# def from_json( cls , dct ) : #NEWLINE# #INDENT# ret_val = cls ( ) #NEWLINE# for ( key , value ) in dct . items ( ) : #NEWLINE# #INDENT# if ( key == 'inherits_from' ) : #NEWLINE# #INDENT# inherit_links = [ ] #NEWLINE# for l_dict in value : #NEWLINE# #INDENT# link = common_types . Link ( href = l_dict [ 'href' ] , target_name = l_dict [ 'target_name' ] ) #NEWLINE# inherit_links . append ( link ) #NEWLINE# #UNINDENT# setattr ( ret_val , 'inherits_from' , inherit_links ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( key == 'attribute_definition_links' ) : #NEWLINE# #INDENT# ad_links = [ ] #NEWLINE# for ad_dct in value : #NEWLINE# #INDENT# ad_link = AttributeLink . from_json ( ad_dct ) #NEWLINE# ad_links . append ( ad_link ) #NEWLINE# #UNINDENT# setattr ( ret_val , 'attribute_definition_links' , ad_links ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if hasattr ( ret_val , key ) : #NEWLINE# #INDENT# setattr ( ret_val , key , value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# core . abort ( 500 , 'internal metadata is incorrect' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return ret_val