code: def set_once_cache_used(f) -> None:
      """One-time setting of _cache_used.
  
      If _cache_used is False, set it to True and execute the provided function
      f. No action if _cache_used is True. This provides a mechanism to execute f
      once per task. Note that reset_cache() will reset _cache_used also.
      """
      global _cache_used
      with _cache_initialized_mutex:
          if not _cache_used:
              _cache_used = True
              if f is not None:
                  f()
  
imports: from __future__ import annotations
  import logging
  import threading
  import warnings
  import zlib
  import numpy
  from jax._src import cache_key
  from jax._src.compilation_cache_interface import CacheInterface
  from jax._src import config
  from jax._src import monitoring
  from jax._src.gfile_cache import GFileCache
  from jax._src.lib import xla_client
  from jax._src.lib.mlir import ir
label_desc: Use image node_id 1 for calling a global function with example usage: set_once_cache_used(f) without return types