<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_cachedir():
 """Return the pants global cache directory."""

  # Follow the unix XDB base spec: http://standards.freedesktop.org/basedir-spec/latest/index.html.
  cache_home = os.environ.get('XDG_CACHE_HOME')
  if not cache_home:
    cache_home = '~/.cache'
  return os.path.expanduser(os.path.join(cache_home, 'pants'))