code: def get_data_cache_dir(data_dir, subdir=None):
      """
      Function for getting cache directory to store data cache files.
  
      Since the data cache contains large files, it is ideal to control the
      location independently from the system cache, which defaults to
      the user homedir if not otherwise specified.
  
      This function will make the directory if it doesn't yet exist.
  
      Arguments:
          data_dir (str): the dir to use if NEON_DATA_CACHE_DIR is not
                          present in the environment.
          subdir (str): sub directory inside of the cache dir that should
                        be returned.
      """
      data_cache_dir = os.environ.get("NEON_DATA_CACHE_DIR")
  
      if data_cache_dir is None:
          data_cache_dir = data_dir
  
      if subdir:
          subdir = subdir if isinstance(subdir, list) else [subdir]
          data_cache_dir = os.path.join(data_cache_dir, *subdir)
  
      if not os.path.exists(data_cache_dir):
          os.makedirs(data_cache_dir)
  
      return data_cache_dir
  
file_path: neon/neon/util/persist.py
imports: import importlib
  import logging
  import os
  import pkgutil
  import sys
  import appdirs
  from neon.util.compat import pickle, pickle_load
label_desc: Use image node_id 2 for calling a global function with example usage: get_data_cache_dir(data_dir, subdir) and returns: data_cache_dir