code: def get_dataset_cache(
      self,
      config: dict,
      dataset: Optional[CacheableDataset] = None,
      training_set: Optional[CacheableDataset] = None,
      test_set: Optional[CacheableDataset] = None,
      validation_set: Optional[CacheableDataset] = None,
  ) -> DatasetCache:
      if dataset is not None:
          key = self.get_cache_key(dataset, config)
          cache_map = {
              META: self.get_cache_path(dataset, key, META, "json"),
              TRAINING: self.get_cache_path(dataset, key, TRAINING),
              TEST: self.get_cache_path(dataset, key, TEST),
              VALIDATION: self.get_cache_path(dataset, key, VALIDATION),
          }
          return DatasetCache(
              config, key, cache_map, self._dataset_manager
          )
      else:
          key = self.get_cache_key(training_set, config)
          cache_map = {
              META: self.get_cache_path(
                  training_set, key, META, "json"
              ),
              TRAINING: self.get_cache_path(
                  training_set, key, TRAINING
              ),
              TEST: self.get_cache_path(test_set, key, TEST),
              VALIDATION: self.get_cache_path(
                  validation_set, key, VALIDATION
              ),
          }
          return DatasetCache(
              config, key, cache_map, self._dataset_manager
          )
  
imports: import logging
  import os
  from typing import Optional
  from ludwig.constants import CHECKSUM, META, TEST, TRAINING, VALIDATION
  from ludwig.data.cache.types import alphanum, CacheableDataset
  from ludwig.data.cache.util import calculate_checksum
  from ludwig.data.dataset.base import DatasetManager
  from ludwig.utils import data_utils
  from ludwig.utils.fs_utils import delete, path_exists
label_desc: Use image node_id 2 for calling the CacheManager obj's underlying member method code with example usage: obj.get_dataset_cache(config, dataset, training_set, test_set, validation_set) and returns: DatasetCache, DatasetCache