code: def read_and_validate_value_from_cache(
      param_name: str, default_param_value: str
  ) -> tuple[bool, str | None]:
      """
      Reads and validates value from cache is present and whether its value is valid according to current rules.
      It could happen that the allowed values have been modified since the last time cached value was set,
      so this check is crucial to check outdated values.
      If the value is not set or in case the cached value stored is not currently allowed,
      the default value is stored in the cache and returned instead.
  
      :param param_name: name of the parameter
      :param default_param_value: default value of the parameter
      :return: Tuple informing whether the value was read from cache and the parameter value that is
           set in the cache after this method returns.
      """
      is_from_cache = False
      cached_value = read_from_cache_file(param_name)
      if cached_value is None:
          write_to_cache_file(param_name, default_param_value)
          cached_value = default_param_value
      else:
          allowed, allowed_values = check_if_values_allowed(
              param_name, cached_value
          )
          if allowed:
              is_from_cache = True
          else:
              write_to_cache_file(param_name, default_param_value)
              cached_value = default_param_value
      return is_from_cache, cached_value
  
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 5 for calling a global function with example usage: read_and_validate_value_from_cache(param_name, default_param_value) and returns: is_from_cache,  cached_value