def METHOD_NAME(self, conditional: str, templar: Templar, all_vars: dict[str, t.Any]) -> bool:
    original = conditional
    templar.available_variables = all_vars
    try:
        if templar.is_template(conditional):
            display.warning(
                "conditional statements should not include jinja2 "
                "templating delimiters such as {{ }} or {%% %%}. "
                "Found: %s" % conditional
            )
            conditional = templar.template(conditional)
            if isinstance(conditional, bool):
                return conditional
            elif conditional == "":
                return False
        # If the result of the first-pass template render (to resolve inline templates) is marked unsafe,
        # explicitly disable lookups on the final pass to prevent evaluation of untrusted content in the
        # constructed template.
        disable_lookups = hasattr(conditional, '__UNSAFE__')
        # NOTE The spaces around True and False are intentional to short-circuit literal_eval for
        #      jinja2_native=False and avoid its expensive calls.
        return templar.template(
            "{%% if %s %%} True {%% else %%} False {%% endif %%}" % conditional,
            disable_lookups=disable_lookups).strip() == "True"
    except AnsibleUndefinedVariable as e:
        raise AnsibleUndefinedVariable("error while evaluating conditional (%s): %s" % (original, e))