parameters: (known_paths)
return_statement: return known_paths
docstring: Add site-packages (and possibly site-python) to sys.path
docstring_summary: Add site-packages (and possibly site-python) to sys.path
docstring_tokens: Add site - packages ( and possibly site - python ) to sys . path
function: def addsitepackages(known_paths):
      """Add site-packages (and possibly site-python) to sys.path"""
      sitedirs = []
      seen = []
  
      for prefix in PREFIXES:
          if not prefix or prefix in seen:
              continue
          seen.append(prefix)
  
          if sys.platform in ('os2emx', 'riscos'):
              sitedirs.append(os.path.join(prefix, "Lib", "site-packages"))
          elif os.sep == '/':
              sitedirs.append(os.path.join(prefix, "lib",
                                          "python" + sys.version[:3],
                                          "site-packages"))
              sitedirs.append(os.path.join(prefix, "lib", "site-python"))
          else:
              sitedirs.append(prefix)
              sitedirs.append(os.path.join(prefix, "lib", "site-packages"))
  
          if sys.platform == "darwin":
              # 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' in prefix:
                  sitedirs.append(
                      os.path.expanduser(
                          os.path.join("~", "Library", "Python",
                                       sys.version[:3], "site-packages")))
  
      for sitedir in sitedirs:
          if os.path.isdir(sitedir):
              addsitedir(sitedir, known_paths)
  
      return known_paths
function_tokens: def addsitepackages ( known_paths ) : sitedirs = [ ] seen = [ ] for prefix in PREFIXES : if not prefix or prefix in seen : continue seen . append ( prefix ) if sys . platform in ( 'os2emx' , 'riscos' ) : sitedirs . append ( os . path . join ( prefix , "Lib" , "site-packages" ) ) elif os . sep == '/' : sitedirs . append ( os . path . join ( prefix , "lib" , "python" + sys . version [ : 3 ] , "site-packages" ) ) sitedirs . append ( os . path . join ( prefix , "lib" , "site-python" ) ) else : sitedirs . append ( prefix ) sitedirs . append ( os . path . join ( prefix , "lib" , "site-packages" ) ) if sys . platform == "darwin" : # 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' in prefix : sitedirs . append ( os . path . expanduser ( os . path . join ( "~" , "Library" , "Python" , sys . version [ : 3 ] , "site-packages" ) ) ) for sitedir in sitedirs : if os . path . isdir ( sitedir ) : addsitedir ( sitedir , known_paths ) return known_paths