code: def write_to_cache_file(
      param_name: str,
      param_value: str,
      check_allowed_values: bool = True,
  ) -> None:
      """
      Writs value to cache. If asked it can also check if the value is allowed for the parameter. and exit
      in case the value is not allowed for that parameter instead of writing it.
      :param param_name: name of the parameter
      :param param_value: new value for the parameter
      :param check_allowed_values: whether to fail if the parameter value is not allowed for that name.
      """
      allowed = False
      allowed_values = None
      if check_allowed_values:
          allowed, allowed_values = check_if_values_allowed(
              param_name, param_value
          )
      if allowed or not check_allowed_values:
          cache_path = Path(BUILD_CACHE_DIR, f".{param_name}")
          cache_path.parent.mkdir(parents=True, exist_ok=True)
          cache_path.write_text(param_value)
      else:
          get_console().print(
              f"[cyan]You have sent the {param_value} for {param_name}"
          )
          get_console().print(
              f"[cyan]Allowed value for the {param_name} are {allowed_values}"
          )
          get_console().print(
              "[cyan]Provide one of the supported params. Write to cache dir failed"
          )
          sys.exit(1)
  
file_path: airflow/dev/breeze/src/airflow_breeze/utils/cache.py
imports: from __future__ import annotations
  import sys
  from pathlib import Path
  from typing import Any
  from airflow_breeze import global_constants
  from airflow_breeze.utils.console import get_console
  from airflow_breeze.utils.path_utils import BUILD_CACHE_DIR
label_desc: Use image node_id 4 for calling a global function with example usage: write_to_cache_file(param_name, param_value, check_allowed_values) without return types