def __init__(self, jsonstr=None, key=None, warnings=None):
        ''' Initialization of the object

        Args:
            jsonstr (str): a raw JSON string that is returned by a request.
                We store all the data in `self.json_data` and use `__getattr__`
                and `__setattr__` to make the data accessible like attributes
                of the object
            key (str): Optional key to use with jsonstr. If `key` exists, we'll
                load the data of `jsonstr[key]` instead of the whole `jsonstr`
        '''
        super(Resource, self).__init__()
        self.warnings = warnings
        if jsonstr is not None:
            data = json.loads(json.dumps(jsonstr))
            if key is not None:
                object.__setattr__(self, 'json_data', data[key])
            else:
                object.__setattr__(self, 'json_data', data)
def __init__ ( self , jsonstr = None , key = None , warnings = None ) : super ( Resource , self ) . __init__ ( ) self . warnings = warnings if jsonstr is not None : data = json . loads ( json . dumps ( jsonstr ) ) if key is not None : object . __setattr__ ( self , 'json_data' , data [ key ] ) else : object . __setattr__ ( self , 'json_data' , data )
Initialization of the object

        Args:
            jsonstr (str): a raw JSON string that is returned by a request.
                We store all the data in `self.json_data` and use `__getattr__`
                and `__setattr__` to make the data accessible like attributes
                of the object
            key (str): Optional key to use with jsonstr. If `key` exists, we'll
                load the data of `jsonstr[key]` instead of the whole `jsonstr`