parameters: ()
return_statement: return os.path.expanduser(os.path.join('~', '.cython'))
docstring: r"""
      Return the base directory containing Cython's caches.
  
      Priority:
  
      1. CYTHON_CACHE_DIR
      2. (OS X): ~/Library/Caches/Cython
         (posix not OS X): XDG_CACHE_HOME/cython if XDG_CACHE_HOME defined
      3. ~/.cython
docstring_summary: r"""
      Return the base directory containing Cython's caches.
docstring_tokens: r Return the base directory containing Cython s caches .
function: def get_cython_cache_dir():
      r"""
      Return the base directory containing Cython's caches.
  
      Priority:
  
      1. CYTHON_CACHE_DIR
      2. (OS X): ~/Library/Caches/Cython
         (posix not OS X): XDG_CACHE_HOME/cython if XDG_CACHE_HOME defined
      3. ~/.cython
  
      """
      if 'CYTHON_CACHE_DIR' in os.environ:
          return os.environ['CYTHON_CACHE_DIR']
  
      parent = None
      if os.name == 'posix':
          if sys.platform == 'darwin':
              parent = os.path.expanduser('~/Library/Caches')
          else:
              # this could fallback on ~/.cache
              parent = os.environ.get('XDG_CACHE_HOME')
  
      if parent and os.path.isdir(parent):
          return os.path.join(parent, 'cython')
  
      # last fallback: ~/.cython
      return os.path.expanduser(os.path.join('~', '.cython'))
function_tokens: def get_cython_cache_dir ( ) : if 'CYTHON_CACHE_DIR' in os . environ : return os . environ [ 'CYTHON_CACHE_DIR' ] parent = None if os . name == 'posix' : if sys . platform == 'darwin' : parent = os . path . expanduser ( '~/Library/Caches' ) else : # this could fallback on ~/.cache parent = os . environ . get ( 'XDG_CACHE_HOME' ) if parent and os . path . isdir ( parent ) : return os . path . join ( parent , 'cython' ) # last fallback: ~/.cython return os . path . expanduser ( os . path . join ( '~' , '.cython' ) )