code: def config_dir(mkcustom=False):
      
      from acorn.utility import reporoot
      from acorn.base import testmode
      from os import path
      alternate = path.join(path.abspath(path.expanduser("~")), ".acorn")
      if testmode or (not path.isdir(alternate) and not mkcustom):
          return path.join(reporoot, "acorn", "config")
      else:
          if mkcustom:# pragma: no cover
              #This never gets reached when we are in testmode because we don't
              #want to clobber the user's local config cache.
              from os import mkdir
              mkdir(alternate)
          return alternate
docs: Returns the configuration directory for custom package settings.