code: def load_config(bentoml_config_file: str | None = None):
      """Load global configuration of BentoML"""
  
      from .containers import BentoMLConfiguration
      from .containers import BentoMLContainer
  
      if not bentoml_config_file:
          bentoml_config_file = get_bentoml_config_file_from_env()
  
      if bentoml_config_file:
          if not bentoml_config_file.endswith((".yml", ".yaml")):
              raise BentoMLConfigException(
                  f"BentoML config file specified in ENV VAR does not end with either '.yaml' or '.yml': 'BENTOML_CONFIG={bentoml_config_file}'"
              ) from None
          if not os.path.isfile(bentoml_config_file):
              raise FileNotFoundError(
                  f"BentoML config file specified in ENV VAR not found: 'BENTOML_CONFIG={bentoml_config_file}'"
              ) from None
  
      BentoMLContainer.config.set(
          BentoMLConfiguration(
              override_config_file=bentoml_config_file,
              override_config_values=get_bentoml_override_config_from_env(),
          ).to_dict()
      )
  
imports: from __future__ import annotations
  import importlib.metadata
  import logging
  import os
  import re
  import typing
  from functools import lru_cache
  from ...exceptions import BentoMLConfigException
  from ...exceptions import BentoMLException
label_desc: Use image node_id 10 for calling a global function with example usage: load_config(bentoml_config_file) without return types