from typing import Union


def safe_ord(byte: Union[bytes, int]) -> int:
    """If `byte` argument is byte character, returns ord(byte), otherwise returns argument.
    """
    return byte if isinstance(byte, int) else ord(byte)