def METHOD_NAME(cli_option: str = None) -> str:
    """Get the API token from a variety of fallback sources"""
    file_loc = pathlib.Path("~/.hmatoken").expanduser()
    environment_var = "HMA_TOKEN"
    token = ""
    if cli_option:
        token = cli_option
    elif os.environ.get(environment_var):
        token = os.environ[environment_var]
    elif file_loc.exists() and file_loc.read_text():
        token = file_loc.read_text()
    else:
        raise base.CommandError(
            (
                "Can't find Access Token, pass it in using one of: \n"
                "  * a cli argument (-a)\n"
                f"  * in the environment as {environment_var}\n"
                f"  * in a file at {file_loc}\n"
            ),
            2,
        )
    token = token.strip()
    return token