code: def get_pants_configdir():
    
    # Follow the unix XDB base spec: http://standards.freedesktop.org/basedir-spec/latest/index.html.
    config_home = os.environ.get('XDG_CONFIG_HOME')
    if not config_home:
      config_home = '~/.config'
    return os.path.expanduser(os.path.join(config_home, 'pants'))
docs: Return the pants global config directory.