code: def maybe_register_dataset_for_temp_dir_deletion(dataset):
      """
      This function registers the datasets that have cache files in _TEMP_DIR_FOR_TEMP_CACHE_FILES in order
      to properly delete them before deleting the temporary directory.
      The temporary directory _TEMP_DIR_FOR_TEMP_CACHE_FILES is used when caching is disabled.
      """
      if _TEMP_DIR_FOR_TEMP_CACHE_FILES is None:
          return
  
      global _DATASETS_WITH_TABLE_IN_TEMP_DIR
      if _DATASETS_WITH_TABLE_IN_TEMP_DIR is None:
          _DATASETS_WITH_TABLE_IN_TEMP_DIR = weakref.WeakSet()
      if any(
          Path(_TEMP_DIR_FOR_TEMP_CACHE_FILES.name)
          in Path(cache_file["filename"]).parents
          for cache_file in dataset.cache_files
      ):
          _DATASETS_WITH_TABLE_IN_TEMP_DIR.add(dataset)
  
imports: import inspect
  import os
  import random
  import shutil
  import tempfile
  import weakref
  from functools import wraps
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Union
  import numpy
  import xxhash
  from .None import config
  from .naming import INVALID_WINDOWS_CHARACTERS_IN_PATH
  from .utils._dill import dumps
  from .utils.deprecation_utils import deprecated
  from .utils.logging import get_logger
label_desc: Use image node_id 1 for calling a global function with example usage: maybe_register_dataset_for_temp_dir_deletion(dataset) without return types