code: def get_templates_variables(
      docker: DockerOptions,
      conda: CondaOptions,
      bento_fs: FS,
      *,
      _is_cuda: bool = False,
      **bento_env: str | bool,
  ) -> dict[str, t.Any]:
      """
      Returns a dictionary of variables to be used in BentoML base templates.
      """
      conda_python_version = conda.get_python_version(bento_fs)
      if conda_python_version is None:
          conda_python_version = docker.python_version
  
      if docker.base_image is not None:
          base_image = docker.base_image
          logger.info(
              "BentoML will not install Python to custom base images; ensure the base image '%s' has Python installed.",
              base_image,
          )
      else:
          spec = DistroSpec.from_options(docker, conda)
          python_version = docker.python_version
          assert (
              docker.distro is not None and python_version is not None
          )
          if docker.distro in ("ubi8"):
              # ubi8 base images uses "py38" instead of "py3.8" in its image tag
              python_version = python_version.replace(".", "")
          base_image = spec.image.format(spec_version=python_version)
          if docker.cuda_version is not None:
              base_image = spec.image.format(
                  spec_version=docker.cuda_version
              )
  
      # bento__env
      default_env = {
          "uid_gid": BENTO_UID_GID,
          "user": BENTO_USER,
          "home": BENTO_HOME,
          "path": BENTO_PATH,
          "add_header": True,
          "buildkit_frontend": BENTO_BUILDKIT_FRONTEND,
          "enable_buildkit": True,
      }
      if bento_env:
          default_env.update(bento_env)
  
      return {
          **{
              to_options_field(k): v
              for k, v in docker.to_dict().items()
          },
          **{to_bento_field(k): v for k, v in default_env.items()},
          "__prometheus_port__": BentoMLContainer.grpc.metrics.port.get(),
          "__base_image__": base_image,
          "__conda_python_version__": conda_python_version,
          "__is_cuda__": _is_cuda,
      }
  
file_path: BentoML/grpc-client/bentoml/_internal/container/generate.py
imports: from __future__ import annotations
  import logging
  import os
  import typing
  from typing import TYPE_CHECKING
  from jinja2 import Environment
  from jinja2.loaders import FileSystemLoader
  from ..configuration.containers import BentoMLContainer
  from ..utils import resolve_user_filepath
  from .frontend.dockerfile import DistroSpec
label_desc: Use image node_id 4 for calling a global function with example usage: get_templates_variables(docker, conda, bento_fs) and returns: dict