code: def get_app_dir(app_name, roaming=True, force_posix=False):
      r"""Returns the config folder for the application.  The default behavior
      is to return whatever is most appropriate for the operating system.
  
      To give you an idea, for an app called ``"Foo Bar"``, something like
      the following folders could be returned:
  
      Mac OS X:
        ``~/Library/Application Support/Foo Bar``
      Mac OS X (POSIX):
        ``~/.foo-bar``
      Unix:
        ``~/.config/foo-bar``
      Unix (POSIX):
        ``~/.foo-bar``
      Win XP (roaming):
        ``C:\Documents and Settings\<user>\Local Settings\Application Data\Foo Bar``
      Win XP (not roaming):
        ``C:\Documents and Settings\<user>\Application Data\Foo Bar``
      Win 7 (roaming):
        ``C:\Users\<user>\AppData\Roaming\Foo Bar``
      Win 7 (not roaming):
        ``C:\Users\<user>\AppData\Local\Foo Bar``
  
      .. versionadded:: 2.0
  
      :param app_name: the application name.  This should be properly capitalized
                       and can contain whitespace.
      :param roaming: controls if the folder should be roaming or not on Windows.
                      Has no affect otherwise.
      :param force_posix: if this is set to `True` then on any POSIX system the
                          folder will be stored in the home folder with a leading
                          dot instead of the XDG config home or darwin's
                          application support folder.
      """
      if WIN:
          key = "APPDATA" if roaming else "LOCALAPPDATA"
          folder = os.environ.get(key)
          if folder is None:
              folder = os.path.expanduser("~")
          return os.path.join(folder, app_name)
      if force_posix:
          return os.path.join(
              os.path.expanduser("~/.{}".format(_posixify(app_name)))
          )
      if sys.platform == "darwin":
          return os.path.join(
              os.path.expanduser("~/Library/Application Support"),
              app_name,
          )
      return os.path.join(
          os.environ.get(
              "XDG_CONFIG_HOME", os.path.expanduser("~/.config")
          ),
          _posixify(app_name),
      )
  
imports: import os
  import sys
  from ._compat import _default_text_stderr
  from ._compat import _default_text_stdout
  from ._compat import auto_wrap_for_ansi
  from ._compat import binary_streams
  from ._compat import filename_to_ui
  from ._compat import get_filesystem_encoding
  from ._compat import get_streerror
  from ._compat import is_bytes
  from ._compat import open_stream
  from ._compat import PY2
  from ._compat import should_strip_ansi
  from ._compat import string_types
  from ._compat import strip_ansi
  from ._compat import text_streams
  from ._compat import text_type
  from ._compat import WIN
  from .globals import resolve_color_default
label_desc: Use image node_id 11 for calling a global function with example usage: get_app_dir(app_name, roaming, force_posix) and returns: os, os, os, os