code: def sign(message, gpg_home=None, gpg_signing_key=None, **config):
      
  
      if gpg_home is None or gpg_signing_key is None:
          raise ValueError("You must set the gpg_home \
                           and gpg_signing_key keyword arguments.")
  
      message['crypto'] = 'gpg'
  
      signature = _ctx.sign(
          fedmsg.encoding.dumps(message['msg']),
          gpg_signing_key,
          homedir=gpg_home
      )
      return dict(list(message.items()) + [('signature', b64encode(signature))])
docs: Insert a new field into the message dict and return it.
  
      The new field is:
  
          - 'signature' - the computed GPG message digest of the JSON repr
            of the `msg` field.