<s> """<STR_LIT>""" <EOL> import os <EOL> from nuitka . utils import Utils <EOL> def getStandardLibraryPaths ( ) : <EOL> """<STR_LIT>""" <EOL> if not hasattr ( getStandardLibraryPaths , "<STR_LIT:result>" ) : <EOL> os_filename = os . __file__ <EOL> if os_filename . endswith ( "<STR_LIT>" ) : <EOL> os_filename = os_filename [ : - <NUM_LIT:1> ] <EOL> os_path = Utils . normcase ( Utils . dirname ( os_filename ) ) <EOL> stdlib_paths = set ( [ os_path ] ) <EOL> if Utils . isLink ( os_filename ) : <EOL> os_filename = Utils . readLink ( os_filename ) <EOL> stdlib_paths . add ( Utils . normcase ( Utils . dirname ( os_filename ) ) ) <EOL> orig_prefix_filename = Utils . joinpath ( os_path , "<STR_LIT>" ) <EOL> if Utils . isFile ( orig_prefix_filename ) : <EOL> search = os_path <EOL> lib_part = "<STR_LIT>" <EOL> while os . path . splitdrive ( search ) [ <NUM_LIT:1> ] not in ( os . path . sep , "<STR_LIT>" ) : <EOL> if Utils . isFile ( Utils . joinpath ( search , "<STR_LIT>" ) ) or Utils . isFile ( Utils . joinpath ( search , "<STR_LIT>" ) ) : <EOL> break <EOL> lib_part = Utils . joinpath ( Utils . basename ( search ) , lib_part ) <EOL> search = Utils . dirname ( search ) <EOL> assert search and lib_part <EOL> stdlib_paths . add ( <EOL> Utils . normcase ( <EOL> Utils . joinpath ( <EOL> open ( orig_prefix_filename ) . read ( ) , <EOL> lib_part , <EOL> ) <EOL> ) <EOL> ) <EOL> python_link_filename = Utils . joinpath ( os_path , "<STR_LIT:..>" , "<STR_LIT>" ) <EOL> if Utils . isLink ( python_link_filename ) : <EOL> stdlib_paths . add ( <EOL> Utils . normcase ( <EOL> Utils . joinpath ( <EOL> Utils . readLink ( python_link_filename ) , <EOL> "<STR_LIT>" <EOL> ) <EOL> ) <EOL> ) <EOL> for stdlib_path in set ( stdlib_paths ) : <EOL> candidate = Utils . joinpath ( stdlib_path , "<STR_LIT>" ) <EOL> if Utils . isDir ( candidate ) : <EOL> stdlib_paths . add ( candidate ) <EOL> getStandardLibraryPaths . result = [ <EOL> Utils . normcase ( stdlib_path ) <EOL> for stdlib_path in <EOL> stdlib_paths <EOL> ] <EOL> return getStandardLibraryPaths . result <EOL> def isStandardLibraryPath ( path ) : <EOL> """<STR_LIT>""" <EOL> path = Utils . normcase ( path ) <EOL> if os . path . basename ( path ) == "<STR_LIT>" : <EOL> return True <EOL> if "<STR_LIT>" in path or "<STR_LIT>" in path : <EOL> return False <EOL> for candidate in getStandardLibraryPaths ( ) : <EOL> if path . startswith ( candidate ) : <EOL> return True <EOL> return False </s>
