<s> """<STR_LIT>""" <EOL> import json <EOL> from cafe . engine . models . base import AutoMarshallingListModel , AutoMarshallingModel <EOL> class IPAssociation ( AutoMarshallingModel ) : <EOL> """<STR_LIT>""" <EOL> IP_ASSOCIATION = '<STR_LIT>' <EOL> def __init__ ( self , id_ = None , address = None , ** kwargs ) : <EOL> super ( IPAssociation , self ) . __init__ ( ) <EOL> self . id = id_ <EOL> self . address = address <EOL> @ classmethod <EOL> def _json_to_obj ( cls , serialized_str ) : <EOL> """<STR_LIT>""" <EOL> ret = None <EOL> json_dict = json . loads ( serialized_str ) <EOL> json_dict = cls . _replace_dict_key ( <EOL> json_dict , '<STR_LIT:id>' , '<STR_LIT>' , recursion = True ) <EOL> if cls . IP_ASSOCIATION in json_dict : <EOL> ip_address_dict = json_dict . get ( cls . IP_ASSOCIATION ) <EOL> ret = IPAssociation ( ** ip_address_dict ) <EOL> return ret <EOL> class IPAssociations ( AutoMarshallingListModel ) : <EOL> IP_ASSOCIATIONS = '<STR_LIT>' <EOL> @ classmethod <EOL> def _json_to_obj ( cls , serialized_str ) : <EOL> """<STR_LIT>""" <EOL> ret = cls ( ) <EOL> json_dict = json . loads ( serialized_str ) <EOL> json_dict = cls . _replace_dict_key ( <EOL> json_dict , '<STR_LIT:id>' , '<STR_LIT>' , recursion = True ) <EOL> if cls . IP_ASSOCIATIONS in json_dict : <EOL> ip_associations = json_dict . get ( cls . IP_ASSOCIATIONS ) <EOL> for ip_association in ip_associations : <EOL> result = IPAssociation ( ** ip_association ) <EOL> ret . append ( result ) <EOL> return ret </s>
