code: def create_task_cache_dict(task_cache_config_dict: Dict) -> Dict:
      """Takes a map of task cache configs, and returns map of instantiated task data cache objects.
  
      Notes:
          This function assumes that data is divided and stored according to phase where phase takes
          a value of train, val, val_labels, or test.
  
      Args:
          task_cache_config_dict (Dict[str, Dict[str, str]]): maps of task names to cache file dirs.
  
      Returns:
          Dict[str, Dict[str, ChunkedFilesDataCache]] mappings from task name to task cache objects.
  
      """
      task_cache_dict = {}
      for (
          task_name,
          task_cache_config,
      ) in task_cache_config_dict.items():
          single_task_cache_dict = {}
          for phase in ["train", "val", "val_labels", "test"]:
              if phase in task_cache_config:
                  single_task_cache_dict[
                      phase
                  ] = caching.ChunkedFilesDataCache(
                      task_cache_config[phase],
                  )
          task_cache_dict[task_name] = single_task_cache_dict
      return task_cache_dict
  
imports: import warnings
  from dataclasses import dataclass
  from typing import Dict, List, Optional
  import jiant.proj.main.components.task_sampler
  import jiant.shared.caching
  from jiant.tasks.core import Task
  from jiant.tasks.retrieval import create_task_from_config_path
  import jiant.utils.python.io
  from jiant.utils.python.datastructures import ExtendedDataClassMixin
label_desc: Use image node_id 2 for calling a global function with example usage: create_task_cache_dict(task_cache_config_dict) and returns: task_cache_dict