code: def _get_html_templates_env(kind):
      # For _html_repr_() and mne.Report
      assert kind in ("repr", "report"), kind
      import jinja2
  
      templates_env = jinja2.Environment(
          loader=jinja2.PackageLoader(
              package_name="mne.html_templates", package_path=kind
          ),
          autoescape=jinja2.select_autoescape(
              default=True, default_for_string=True
          ),
      )
      if kind == "report":
          templates_env.filters["zip"] = zip
      return templates_env
  
imports: import functools
label_desc: Use image node_id 1 for calling a global function with example usage: _get_html_templates_env(kind) and returns: templates_env