code: def _set_attrs(self, attrs, allow_ro=False, from_json=True):
      
      for k, v in attrs.iteritems():
        attr = self._check_attr(k, allow_ro)
        if attr and from_json:
          v = attr.from_json(self._get_resource_root(), v)
        object.__setattr__(self, k, v)
docs: Sets all the attributes in the dictionary. Optionally, allows setting
      read-only attributes (e.g. when deserializing from JSON) and skipping
      JSON deserialization of values.