def filter_allowed_args(func, **kwargs):
    """
    It takes a function and a dictionary of arguments, and returns a dictionary of arguments that are
    allowed by the function

    Args:
      func: The function to filter the arguments for.

    Returns:
      A dictionary of the arguments that are allowed in the function.
    """
    allowed_args = {key: val for key, val in kwargs.items() if key in func.__code__.co_varnames}
    for key in args_to_remove:
        if key in allowed_args:
            del allowed_args[key]
    return allowed_args

    It takes a function and a dictionary of arguments, and returns a dictionary of arguments that are
    allowed by the function

    Args:
      func: The function to filter the arguments for.

    Returns:
      A dictionary of the arguments that are allowed in the function.
    
argilla-v1/src/argilla_v1/training/utils.py