parameters: ()
return_statement: return sitedirs
docstring: Return a list of 'site' dirs
docstring_summary: Return a list of 'site' dirs
docstring_tokens: Return a list of site dirs
function: def get_site_dirs():
      """
      Return a list of 'site' dirs
      """
  
      sitedirs = []
  
      # start with PYTHONPATH
      sitedirs.extend(_pythonpath())
  
      prefixes = [sys.prefix]
      if sys.exec_prefix != sys.prefix:
          prefixes.append(sys.exec_prefix)
      for prefix in prefixes:
          if not prefix:
              continue
  
          if sys.platform in ('os2emx', 'riscos'):
              sitedirs.append(os.path.join(prefix, "Lib", "site-packages"))
          elif os.sep == '/':
              sitedirs.extend([
                  os.path.join(
                      prefix,
                      "lib",
                      "python{}.{}".format(*sys.version_info),
                      "site-packages",
                  ),
                  os.path.join(prefix, "lib", "site-python"),
              ])
          else:
              sitedirs.extend([
                  prefix,
                  os.path.join(prefix, "lib", "site-packages"),
              ])
          if sys.platform != 'darwin':
              continue
  
          # for framework builds *only* we add the standard Apple
          # locations. Currently only per-user, but /Library and
          # /Network/Library could be added too
          if 'Python.framework' not in prefix:
              continue
  
          home = os.environ.get('HOME')
          if not home:
              continue
  
          home_sp = os.path.join(
              home,
              'Library',
              'Python',
              '{}.{}'.format(*sys.version_info),
              'site-packages',
          )
          sitedirs.append(home_sp)
      lib_paths = get_path('purelib'), get_path('platlib')
  
      sitedirs.extend(s for s in lib_paths if s not in sitedirs)
  
      if site.ENABLE_USER_SITE:
          sitedirs.append(site.USER_SITE)
  
      with contextlib.suppress(AttributeError):
          sitedirs.extend(site.getsitepackages())
  
      sitedirs = list(map(normalize_path, sitedirs))
  
      return sitedirs
function_tokens: def get_site_dirs ( ) : sitedirs = [ ] # start with PYTHONPATH sitedirs . extend ( _pythonpath ( ) ) prefixes = [ sys . prefix ] if sys . exec_prefix != sys . prefix : prefixes . append ( sys . exec_prefix ) for prefix in prefixes : if not prefix : continue if sys . platform in ( 'os2emx' , 'riscos' ) : sitedirs . append ( os . path . join ( prefix , "Lib" , "site-packages" ) ) elif os . sep == '/' : sitedirs . extend ( [ os . path . join ( prefix , "lib" , "python{}.{}" . format ( * sys . version_info ) , "site-packages" , ) , os . path . join ( prefix , "lib" , "site-python" ) , ] ) else : sitedirs . extend ( [ prefix , os . path . join ( prefix , "lib" , "site-packages" ) , ] ) if sys . platform != 'darwin' : continue # for framework builds *only* we add the standard Apple # locations. Currently only per-user, but /Library and # /Network/Library could be added too if 'Python.framework' not in prefix : continue home = os . environ . get ( 'HOME' ) if not home : continue home_sp = os . path . join ( home , 'Library' , 'Python' , '{}.{}' . format ( * sys . version_info ) , 'site-packages' , ) sitedirs . append ( home_sp ) lib_paths = get_path ( 'purelib' ) , get_path ( 'platlib' ) sitedirs . extend ( s for s in lib_paths if s not in sitedirs ) if site . ENABLE_USER_SITE : sitedirs . append ( site . USER_SITE ) with contextlib . suppress ( AttributeError ) : sitedirs . extend ( site . getsitepackages ( ) ) sitedirs = list ( map ( normalize_path , sitedirs ) ) return sitedirs