def METHOD_NAME(decorated_function: Callable[[Any], Any | None]):
    def _get_context(args: Any, kwargs: dict) -> Context:
        arg_names = decorated_function.__code__.co_varnames[
            : decorated_function.__code__.co_argcount
        ]
        search_args = dict(zip(arg_names, args))
        search_args.update(kwargs)
        key_parts: Deque[str] = deque()
        for arg in target_args:
            sub_args = arg.split(".")
            main_arg = sub_args[0]
            if main_arg not in search_args:
                raise ValueError(
                    f"Expected '{main_arg}' in '{decorated_function.__name__}'"
                    f" arguments. Got '{search_args}'"
                )
            context_key = search_args[main_arg]
            for attribute in sub_args[1:]:
                potential_key = getattr(context_key, attribute)
                if not potential_key:
                    raise ValueError(
                        f"Expected '{attribute}' attribute in '{context_key.__name__}' arguments."
                    )
                context_key = potential_key
            key_parts.append(f"{decorated_function.__name__}_{context_key}")
        key = ":".join(map(str, key_parts))
        if key not in _sequential_jobs_contexts:
            _sequential_jobs_contexts[key] = Context(
                in_queue=asyncio.Queue(),
                out_queue=asyncio.Queue(),
                initialized=False,
            )
        return _sequential_jobs_contexts[key]
    # --------------------
    @wraps(decorated_function)
    async def wrapper(*args: Any, **kwargs: Any) -> Any:
        context: Context = _get_context(args, kwargs)
        if not context.initialized:
            context.initialized = True
            async def worker(in_q: Queue, out_q: Queue) -> None:
                while True:
                    awaitable = await in_q.get()
                    in_q.task_done()
                    # check if requested to shutdown
                    if awaitable is None:
                        break
                    try:
                        result = await awaitable
                    except Exception as e:  # pylint: disable=broad-except
                        result = e
                    await out_q.put(result)
                logging.info(
                    "Closed worker for @run_sequentially_in_context applied to '%s' with target_args=%s",
                    decorated_function.__name__,
                    target_args,
                )
            context.task = asyncio.create_task(
                worker(context.in_queue, context.out_queue)
            )
        await context.in_queue.put(decorated_function(*args, **kwargs))
        wrapped_result = await context.out_queue.get()
        if isinstance(wrapped_result, Exception):
            raise wrapped_result
        return wrapped_result
    return wrapper