code: def pickled(cls, obj, **kwargs):
          
          self = cls(**kwargs)
          try:
              self.data = pickle__dumps(obj, protocol=2)
          except pickle.PicklingError:
              e = sys.exc_info()[1]
              self.data = pickle__dumps(CallError(e), protocol=2)
          return self
docs: Construct a pickled message, setting :attr:`data` to the serialization
          of `obj`, and setting remaining fields using `kwargs`.
  
          :returns:
              The new message.