code: def cache_to_zarr_if(
      cache_config_key: str,
      uncacheable_arg_types=DEFAULT_UNCACHE_TYPES,
      sanitize_args_func: Optional[Callable] = None,
  ) -> Callable:
      """Decorate a function and cache the results as a zarr array on disk.
  
      This only happens if the ``satpy.config`` boolean value for the provided
      key is ``True`` as well as some other conditions. See
      :class:`ZarrCacheHelper` for more information. Most importantly, this
      decorator does not limit how many items can be cached and does not clear
      out old entries. It is up to the user to manage the size of the cache.
  
      """
  
      def _decorator(func: Callable) -> Callable:
          zarr_cacher = ZarrCacheHelper(
              func,
              cache_config_key,
              uncacheable_arg_types,
              sanitize_args_func,
          )
          wrapper = update_wrapper(zarr_cacher, func)
          return wrapper
  
      return _decorator
  
imports: from __future__ import annotations
  import hashlib
  import os
  import shutil
  import warnings
  from datetime import datetime
  from functools import update_wrapper
  from glob import glob
  from typing import Any, Callable, Optional, Union
  import dask
  import numpy
  import xarray
  from dask import array
  from pyorbital.astronomy import cos_zen
  from pyorbital.astronomy import get_alt_az
  from pyorbital.orbital import get_observer_look
  from pyresample.geometry import AreaDefinition, StackedAreaDefinition, SwathDefinition
  import satpy
  from satpy.utils import PerformanceWarning, get_satpos, ignore_invalid_float_warnings
label_desc: Use image node_id 2 for calling a global function with example usage: cache_to_zarr_if(cache_config_key, uncacheable_arg_types, sanitize_args_func) and returns: _decorator, wrapper