def METHOD_NAME(client, name, account_name=None, by_subscription=None):
    if account_name is not None and name is not None:
        return client.get(billing_account_name=account_name, invoice_name=name)
    if name is not None and not by_subscription:
        return client.get_by_id(name)
    if by_subscription and name:
        return client.get_by_subscription_and_invoice_id(name)
    from azure.cli.core.azclierror import CLIInternalError
    raise CLIInternalError(
        "Uncaught argument combinations for Azure CLI to handle. Please submit an issue"
    )