code: def public_key_to_address(public_key: Union[PublicKey, bytes]) -> ChecksumAddress:
      
      if isinstance(public_key, PublicKey):
          public_key = public_key.format(compressed=False)
      assert isinstance(public_key, bytes)
      return to_checksum_address(sha3(public_key[1:])[-20:])
docs: Converts a public key to an Ethereum address.