# Path: src/jinja2/utils.py
# class _PassArg(enum.Enum):
#     context = enum.auto()
#     eval_context = enum.auto()
#     environment = enum.auto()
# 
#     @classmethod
#     def from_obj(cls, obj: F) -> t.Optional["_PassArg"]:
#         if hasattr(obj, "jinja_pass_arg"):
#             return obj.jinja_pass_arg  # type: ignore
# 
#         return None


import inspect
import operator
import typing as t
    import typing_extensions as te
from collections import deque
from markupsafe import Markup
from .utils import _PassArg
    from .environment import Environment
        from .compiler import has_safe_repr
    _is_filter = True

    def as_const(self, eval_ctx: t.Optional[EvalContext] = None) -> t.Any:
        eval_ctx = get_eval_context(self, eval_ctx)

        if eval_ctx.volatile:
            raise Impossible()

        if self._is_filter:
            env_map = eval_ctx.environment.filters
        else:
            env_map = eval_ctx.environment.tests

        func = env_map.get(self.name)
        pass_arg = _PassArg.from_obj(func)  # type: ignore

        if func is None or pass_arg is _PassArg.context:
            raise Impossible()

        if eval_ctx.environment.is_async and (
            getattr(func, "jinja_async_variant", False) is True
            or inspect.iscoroutinefunction(func)
        ):
            raise Impossible()

        args, kwargs = args_as_const(self, eval_ctx)
        args.insert(0, self.node.as_const(eval_ctx))

        if pass_arg is _PassArg.eval_context:
            args.insert(0, eval_ctx)

# Path: src/jinja2/utils.py
# class _PassArg(enum.Enum):
#     context = enum.auto()
#     eval_context = enum.auto()
#     environment = enum.auto()
# 
#     @classmethod
#     def from_obj(cls, obj: F) -> t.Optional["_PassArg"]:
#         if hasattr(obj, "jinja_pass_arg"):
#             return obj.jinja_pass_arg  # type: ignore
# 
#         return None


# Path: src/jinja2/nodes.py
import inspect
import operator
import typing as t
    import typing_extensions as te
from collections import deque
from markupsafe import Markup
from .utils import _PassArg
    from .environment import Environment
        from .compiler import has_safe_repr

    _is_filter = True

    def as_const(self, eval_ctx: t.Optional[EvalContext] = None) -> t.Any:
        eval_ctx = get_eval_context(self, eval_ctx)

        if eval_ctx.volatile:
            raise Impossible()

        if self._is_filter:
            env_map = eval_ctx.environment.filters
        else:
            env_map = eval_ctx.environment.tests

        func = env_map.get(self.name)
        pass_arg = _PassArg.from_obj(func)  # type: ignore

        if func is None or pass_arg is _PassArg.context:
            raise Impossible()

        if eval_ctx.environment.is_async and (
            getattr(func, "jinja_async_variant", False) is True
            or inspect.iscoroutinefunction(func)
        ):
            raise Impossible()

        args, kwargs = args_as_const(self, eval_ctx)
        args.insert(0, self.node.as_const(eval_ctx))

        if pass_arg is _PassArg.eval_context:
            args.insert(0, eval_ctx)

        elif pass_arg is _PassArg.environment: