def _int(int_or_str: Any) -> int:
    "return an integer where a single character string may be expected"
    if isinstance(int_or_str, str):
        return ord(int_or_str)
    if isinstance(int_or_str, bytes):
        return int_or_str[0]
    return int(int_or_str)
return an integer where a single character string may be expected