parameters: ()
return_statement: return None
docstring: Return the XDG_CACHE_HOME, if it is defined and exists, else None.
  
      This is only for non-OS X posix (Linux,Unix,etc.) systems.
docstring_summary: Return the XDG_CACHE_HOME, if it is defined and exists, else None.
docstring_tokens: Return the XDG_CACHE_HOME if it is defined and exists else None .
function: def get_xdg_cache_dir():
      """Return the XDG_CACHE_HOME, if it is defined and exists, else None.
  
      This is only for non-OS X posix (Linux,Unix,etc.) systems.
      """
  
      env = os.environ
  
      if os.name == 'posix' and sys.platform != 'darwin':
          # Linux, Unix, AIX, etc.
          # use ~/.cache if empty OR not set
          xdg = env.get("XDG_CACHE_HOME", None) or os.path.join(get_home_dir(), '.cache')
          if xdg and _writable_dir(xdg):
              return py3compat.cast_unicode(xdg, fs_encoding)
  
      return None
function_tokens: def get_xdg_cache_dir ( ) : env = os . environ if os . name == 'posix' and sys . platform != 'darwin' : # Linux, Unix, AIX, etc. # use ~/.cache if empty OR not set xdg = env . get ( "XDG_CACHE_HOME" , None ) or os . path . join ( get_home_dir ( ) , '.cache' ) if xdg and _writable_dir ( xdg ) : return py3compat . cast_unicode ( xdg , fs_encoding ) return None