def METHOD_NAME(
    self,
    task_id: int,
    *,
    function_module: Optional[str] = None,
    function_file: Optional[Path] = None,
    function_parameters: Dict[str, Any],
    clear_existing: bool = False,
    allow_unmatched_labels: bool = False,
) -> None:
    if function_module is not None:
        function = importlib.import_module(function_module)
    elif function_file is not None:
        module_spec = importlib.util.spec_from_file_location("__cvat_function__", function_file)
        function = importlib.util.module_from_spec(module_spec)
        module_spec.loader.exec_module(function)
    else:
        assert False, "function identification arguments missing"
    if hasattr(function, "create"):
        # this is actually a function factory
        function = function.create(**function_parameters)
    else:
        if function_parameters:
            raise TypeError("function takes no parameters")
    cvataa.annotate_task(
        self.client,
        task_id,
        function,
        pbar=DeferredTqdmProgressReporter(),
        clear_existing=clear_existing,
        allow_unmatched_labels=allow_unmatched_labels,
    )