code: def sign(s, passphrase, sig_format=SER_COMPACT, curve='secp160r1'):
      
      if isinstance(s, six.text_type):
          raise ValueError("Encode `s` to a bytestring yourself to" +
                           " prevent problems with different default encodings")
      curve = Curve.by_name(curve)
      privkey = curve.passphrase_to_privkey(passphrase)
      return privkey.sign(hashlib.sha512(s).digest(), sig_format)
docs: Signs `s' with passphrase `passphrase'