code: def render_template(
      template: Any, context: MutableMapping[str, Any], *, native: bool
  ) -> Any:
      """Render a Jinja2 template with given Airflow context.
  
      The default implementation of ``jinja2.Template.render()`` converts the
      input context into dict eagerly many times, which triggers deprecation
      messages in our custom context class. This takes the implementation apart
      and retain the context mapping without resolving instead.
  
      :param template: A Jinja2 template to render.
      :param context: The Airflow task context to render the template with.
      :param native: If set to *True*, render the template into a native type. A
          DAG can enable this with ``render_template_as_native_obj=True``.
      :returns: The render result.
      """
      context = copy.copy(context)
      env = template.environment
      if template.globals:
          context.update(
              (k, v)
              for k, v in template.globals.items()
              if k not in context
          )
      try:
          nodes = template.root_render_func(
              env.context_class(
                  env, context, template.name, template.blocks
              )
          )
      except Exception:
          env.handle_exception()  # Rewrite traceback to point to the template.
      if native:
          import jinja2.nativetypes
  
          return jinja2.nativetypes.native_concat(nodes)
      return "".join(nodes)
  
imports: from __future__ import annotations
  import copy
  import itertools
  import re
  import signal
  import warnings
  from datetime import datetime
  from functools import reduce
  from typing import TYPE_CHECKING, Any, Callable, Generator, Iterable, Mapping, MutableMapping, TypeVar, cast
  from lazy_object_proxy import Proxy
  from airflow.configuration import conf
  from airflow.exceptions import AirflowException, RemovedInAirflow3Warning
  from airflow.utils.module_loading import import_string
  from airflow.utils.types import NOTSET
label_desc: Use image node_id 19 for calling a global function with example usage: render_template(template, context) and returns: str, jinja2