code: def ecdsa_sign(private_key, data, hash_algorithm):
      
  
      if private_key.algorithm != 'ec':
          raise ValueError('The key specified is not an EC private key')
  
      return _sign(private_key, data, hash_algorithm)
docs: Generates an ECDSA signature
  
      :param private_key:
          The PrivateKey to generate the signature with
  
      :param data:
          A byte string of the data the signature is for
  
      :param hash_algorithm:
          A unicode string of "md5", "sha1", "sha256", "sha384" or "sha512"
  
      :raises:
          ValueError - when any of the parameters contain an invalid value
          TypeError - when any of the parameters are of the wrong type
          OSError - when an error is returned by the OS crypto library
  
      :return:
          A byte string of the signature