from typing import Callable


def check_callable_arguments(func: Callable, *args) -> Callable:
    """
    Function checks that the passed callable func accepts arguments passed through args.

    Args:
        func (): Callable function to perform check on.
        *args (): Arguments passed to check presence in passed function.

    Returns:
        Callable: Passed function check passed, otherwise error gets raised.
    """
    var_names = func.__code__.co_varnames
    for i, arg in enumerate(args):
        if var_names[i] != arg:
            error_msg = f"check_function_arguments: Function {func} " \
                        f"does not have the argument {arg} in the right position."
            raise ValueError(error_msg)
    return func