code: def cache_dir(environ=environ):
      try:
          return environ["EMPYRICAL_CACHE_DIR"]
      except KeyError:
          return join(
              environ.get(
                  "XDG_CACHE_HOME",
                  expanduser("~/.cache/"),
              ),
              "empyrical",
          )
  
imports: from datetime import datetime
  from functools import wraps
  from os import makedirs, environ
  from os.path import expanduser, join, getmtime, isdir
  import errno
  import warnings
  import numpy
  from numpy.lib.stride_tricks import as_strided
  import pandas
  from pandas.tseries.offsets import BDay
  from .deprecate import deprecated
label_desc: Use image node_id 6 for calling a global function with example usage: cache_dir(environ) and returns: environ, join