code: def get_env() -> Environment:
      """Get the correct Jinja2 Environment, also for frozen scripts."""
      if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"):
          # PyInstaller uses _MEIPASS and only works with jinja2.FileSystemLoader
          templates_path = join(
              sys._MEIPASS, "bokeh", "core", "_templates"
          )
      else:
          # Non-frozen Python and cx_Freeze can use __file__ directly
          templates_path = join(dirname(__file__), "_templates")
  
      return Environment(
          loader=FileSystemLoader(templates_path),
          trim_blocks=True,
          lstrip_blocks=True,
      )
  
file_path: bokeh/src/bokeh/core/templates.py
imports: from __future__ import annotations
  import logging
  import sys
  from functools import lru_cache
  from os.path import dirname, join
  from typing import Any, Callable
  from jinja2 import Environment, FileSystemLoader, Template
label_desc: Use image node_id 1 for calling a global function with example usage: get_env() and returns: Environment