def METHOD_NAME(self, tmp=None, task_vars=None):
    if task_vars is None:
        task_vars = {}
    result = super().METHOD_NAME(tmp, task_vars)
    del tmp  # tmp no longer has any effect
    # Validate Arguments
    self.templatefile = self._task.args.get("template")
    if not isinstance(self.templatefile, str):
        raise AnsibleActionFail("The argument 'template' must be a string")
    schema = self._task.args.get("schema")
    schema_id = self._task.args.get("schema_id")
    conversion_mode = self._task.args.get("conversion_mode")
    validation_mode = self._task.args.get("validation_mode")
    dest = self._task.args.get("dest")
    if dest is not None and not isinstance(dest, str):
        raise AnsibleActionFail("The argument 'dest' must be a string if set")
    self.add_md_toc = self._task.args.get("add_md_toc", False)
    if not isinstance(self.add_md_toc, bool):
        raise AnsibleActionFail("The argument 'add_md_toc' must be a boolean")
    self.md_toc_skip_lines = self._task.args.get("md_toc_skip_lines", 0)
    if not isinstance(self.md_toc_skip_lines, int):
        raise AnsibleActionFail("The argument 'md_toc_skip_lines' must be an integer")
    # Build data from hostvars and role default vars
    hostname = task_vars["inventory_hostname"]
    # Read ansible variables and perform templating to support inline jinja2
    for var in task_vars:
        if str(var).startswith(("ansible", "molecule", "hostvars", "vars", "avd_switch_facts")):
            continue
        if self._templar.is_template(task_vars[var]):
            # Var contains a jinja2 template.
            try:
                task_vars[var] = self._templar.template(task_vars[var], fail_on_undefined=False)
            except Exception as e:
                raise AnsibleActionFail(f"Exception during templating of task_var '{var}'") from e
    if not isinstance(task_vars, dict):
        # Corner case for ansible-test where the passed task_vars is a nested chain-map
        task_vars = dict(task_vars)
    # Load schema tools and perform conversion and validation
    avdschematools = AvdSchemaTools(
        hostname=hostname,
        ansible_display=display,
        schema=schema,
        schema_id=schema_id,
        conversion_mode=conversion_mode,
        validation_mode=validation_mode,
        plugin_name=task_vars["ansible_role_name"],
    )
    result.update(avdschematools.convert_and_validate_data(task_vars))
    # Template to file
    # Update result from Ansible "copy" operation (setting 'changed' flag accordingly)
    if not result.get("failed"):
        result.update(self.template(task_vars, dest))
    return result