def METHOD_NAME(private_key: Union[str, bytes]) -> str:
    try:
        if isinstance(private_key, str):
            key = SigningKey(bytes.fromhex(private_key))
        elif isinstance(private_key, bytes):
            key = SigningKey(private_key)
        str_key = key_to_str(key)
        if str_key == private_key:
            return str_key
    except Exception:
        pass
    raise Exception(f"{NODE_PRIVATE_KEY} is invalid")