<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_pants_configdir():
 """Return the pants global config directory."""

  # 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'))