code: def get_pants_cachedir():
    
    # 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'))
docs: Return the pants global cache directory.