code: def resolve_dir(env_variable, default="data"):
      default_dir = os.path.join(resolve_cache_dir(), default)
      dir_path = os.getenv(env_variable, default_dir)
  
      if not PathManager.exists(dir_path):
          PathManager.mkdirs(dir_path)
  
      return dir_path
  
imports: import collections
  import json
  import logging
  import os
  import warnings
  from ast import literal_eval
  from typing import List
  import torch
  from mmf.common.registry import registry
  from mmf.utils.env import import_user_module
  from mmf.utils.file_io import PathManager
  from mmf.utils.general import get_absolute_path, get_mmf_root
  from omegaconf import DictConfig, errors, OmegaConf
label_desc: Use image node_id 12 for calling a global function with example usage: resolve_dir(env_variable, default) and returns: dir_path