code: def _update(self, api_obj):
      
      if not isinstance(self, api_obj.__class__):
        raise ValueError(
            "Class %s does not derive from %s; cannot update attributes." %
            (self.__class__, api_obj.__class__))
  
      for name in self._get_attributes().keys():
        try:
          val = getattr(api_obj, name)
          setattr(self, name, val)
        except AttributeError, ignored:
          pass
docs: Copy state from api_obj to this object.