<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _add_details(self, info):
 """ Takes the dict returned by the API call and sets the corresponding attributes on the object. """

        for (key, val) in six.iteritems(info):
            if isinstance(key, six.text_type) and six.PY2:
                key = key.encode(pyrax.get_encoding())
            elif isinstance(key, bytes):
                key = key.decode("utf-8")
            setattr(self, key, val)