<s> """<STR_LIT>""" <EOL> from logging import warning <EOL> from nuitka . Builtins import calledWithBuiltinArgumentNamesDecorator <EOL> from nuitka . nodes . AssignNodes import ( <EOL> ExpressionTargetTempVariableRef , <EOL> ExpressionTempVariableRef , <EOL> StatementAssignmentVariable , <EOL> StatementDelVariable <EOL> ) <EOL> from nuitka . nodes . AttributeNodes import ( <EOL> ExpressionAttributeLookup , <EOL> ExpressionBuiltinGetattr , <EOL> ExpressionBuiltinHasattr , <EOL> ExpressionBuiltinSetattr <EOL> ) <EOL> from nuitka . nodes . BuiltinDecodingNodes import ( <EOL> ExpressionBuiltinChr , <EOL> ExpressionBuiltinOrd , <EOL> ExpressionBuiltinOrd0 <EOL> ) <EOL> from nuitka . nodes . BuiltinDictNodes import ExpressionBuiltinDict <EOL> from nuitka . nodes . BuiltinFormatNodes import ( <EOL> ExpressionBuiltinBin , <EOL> ExpressionBuiltinHex , <EOL> ExpressionBuiltinId , <EOL> ExpressionBuiltinOct <EOL> ) <EOL> from nuitka . nodes . BuiltinHashNodes import ExpressionBuiltinHash <EOL> from nuitka . nodes . BuiltinIteratorNodes import ( <EOL> ExpressionBuiltinIter1 , <EOL> ExpressionBuiltinIter2 , <EOL> ExpressionBuiltinLen , <EOL> ExpressionBuiltinNext1 , <EOL> ExpressionBuiltinNext2 <EOL> ) <EOL> from nuitka . nodes . BuiltinOpenNodes import ExpressionBuiltinOpen <EOL> from nuitka . nodes . BuiltinRangeNodes import ( <EOL> ExpressionBuiltinRange0 , <EOL> ExpressionBuiltinRange1 , <EOL> ExpressionBuiltinRange2 , <EOL> ExpressionBuiltinRange3 <EOL> ) <EOL> from nuitka . nodes . BuiltinRefNodes import ( <EOL> ExpressionBuiltinAnonymousRef , <EOL> ExpressionBuiltinOriginalRef , <EOL> ExpressionBuiltinRef <EOL> ) <EOL> from nuitka . nodes . BuiltinTypeNodes import ( <EOL> ExpressionBuiltinBool , <EOL> ExpressionBuiltinBytearray , <EOL> ExpressionBuiltinComplex , <EOL> ExpressionBuiltinFloat , <EOL> ExpressionBuiltinInt , <EOL> ExpressionBuiltinList , <EOL> ExpressionBuiltinSet , <EOL> ExpressionBuiltinStr , <EOL> ExpressionBuiltinTuple <EOL> ) <EOL> from nuitka . nodes . BuiltinVarsNodes import ExpressionBuiltinVars <EOL> from nuitka . nodes . CallNodes import ( <EOL> ExpressionCallEmpty , <EOL> ExpressionCallNoKeywords <EOL> ) <EOL> from nuitka . nodes . ClassNodes import ExpressionBuiltinType3 <EOL> from nuitka . nodes . ComparisonNodes import ExpressionComparisonIs <EOL> from nuitka . nodes . ConditionalNodes import ( <EOL> ExpressionConditional , <EOL> StatementConditional <EOL> ) <EOL> from nuitka . nodes . ConstantRefNodes import ExpressionConstantRef <EOL> from nuitka . nodes . ExecEvalNodes import ( <EOL> ExpressionBuiltinCompile , <EOL> ExpressionBuiltinEval <EOL> ) <EOL> from nuitka . nodes . GlobalsLocalsNodes import ( <EOL> ExpressionBuiltinDir1 , <EOL> ExpressionBuiltinGlobals , <EOL> ExpressionBuiltinLocals <EOL> ) <EOL> from nuitka . nodes . ImportNodes import ExpressionBuiltinImport <EOL> from nuitka . nodes . NodeMakingHelpers import ( <EOL> makeRaiseExceptionReplacementExpression , <EOL> makeRaiseExceptionReplacementExpressionFromInstance , <EOL> wrapExpressionWithSideEffects <EOL> ) <EOL> from nuitka . nodes . OperatorNodes import ( <EOL> ExpressionOperationNOT , <EOL> ExpressionOperationUnary <EOL> ) <EOL> from nuitka . nodes . OutlineNodes import ExpressionOutlineBody <EOL> from nuitka . nodes . ReturnNodes import StatementReturn <EOL> from nuitka . nodes . SliceNodes import ExpressionBuiltinSlice <EOL> from nuitka . nodes . StatementNodes import StatementsSequence <EOL> from nuitka . nodes . TypeNodes import ( <EOL> ExpressionBuiltinIsinstance , <EOL> ExpressionBuiltinSuper , <EOL> ExpressionBuiltinType1 <EOL> ) <EOL> from nuitka . nodes . VariableRefNodes import ExpressionVariableRef <EOL> from nuitka . Options import isDebug , shallMakeModule <EOL> from nuitka . PythonVersions import python_version <EOL> from nuitka . tree . Helpers import ( <EOL> makeStatementsSequence , <EOL> makeStatementsSequenceFromStatement <EOL> ) <EOL> from nuitka . tree . ReformulationExecStatements import wrapEvalGlobalsAndLocals <EOL> from nuitka . tree . ReformulationTryFinallyStatements import makeTryFinallyStatement <EOL> from nuitka . VariableRegistry import addVariableUsage <EOL> from . import BuiltinOptimization <EOL> def dir_extractor ( node ) : <EOL> def buildDirEmptyCase ( source_ref ) : <EOL> if node . getParentVariableProvider ( ) . isCompiledPythonModule ( ) : <EOL> source = ExpressionBuiltinGlobals ( <EOL> source_ref = source_ref <EOL> ) <EOL> else : <EOL> source = ExpressionBuiltinLocals ( <EOL> source_ref = source_ref <EOL> ) <EOL> result = ExpressionCallEmpty ( <EOL> called = ExpressionAttributeLookup ( <EOL> source = source , <EOL> attribute_name = "<STR_LIT>" , <EOL> source_ref = source_ref <EOL> ) , <EOL> source_ref = source_ref <EOL> ) <EOL> if python_version >= <NUM_LIT> : <EOL> result = ExpressionBuiltinList ( <EOL> value = result , <EOL> source_ref = source_ref <EOL> ) <EOL> return result <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinDir1 , <EOL> builtin_spec = BuiltinOptimization . builtin_dir_spec , <EOL> empty_special_class = buildDirEmptyCase <EOL> ) <EOL> def vars_extractor ( node ) : <EOL> def selectVarsEmptyClass ( source_ref ) : <EOL> if node . getParentVariableProvider ( ) . isCompiledPythonModule ( ) : <EOL> return ExpressionBuiltinGlobals ( <EOL> source_ref = source_ref <EOL> ) <EOL> else : <EOL> return ExpressionBuiltinLocals ( <EOL> source_ref = source_ref <EOL> ) <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinVars , <EOL> builtin_spec = BuiltinOptimization . builtin_vars_spec , <EOL> empty_special_class = selectVarsEmptyClass <EOL> ) <EOL> def import_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinImport , <EOL> builtin_spec = BuiltinOptimization . builtin_import_spec <EOL> ) <EOL> def type_extractor ( node ) : <EOL> args = node . getCallArgs ( ) <EOL> length = args . getIterationLength ( ) <EOL> if length == <NUM_LIT:1> : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinType1 , <EOL> builtin_spec = BuiltinOptimization . builtin_type1_spec <EOL> ) <EOL> else : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinType3 , <EOL> builtin_spec = BuiltinOptimization . builtin_type3_spec <EOL> ) <EOL> def iter_extractor ( node ) : <EOL> @ calledWithBuiltinArgumentNamesDecorator <EOL> def wrapIterCreation ( callable_arg , sentinel , source_ref ) : <EOL> if sentinel is None : <EOL> return ExpressionBuiltinIter1 ( <EOL> value = callable_arg , <EOL> source_ref = source_ref <EOL> ) <EOL> else : <EOL> return ExpressionBuiltinIter2 ( <EOL> callable_arg = callable_arg , <EOL> sentinel = sentinel , <EOL> source_ref = source_ref <EOL> ) <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = wrapIterCreation , <EOL> builtin_spec = BuiltinOptimization . builtin_iter_spec <EOL> ) <EOL> def next_extractor ( node ) : <EOL> def selectNextBuiltinClass ( iterator , default , source_ref ) : <EOL> if default is None : <EOL> return ExpressionBuiltinNext1 ( <EOL> value = iterator , <EOL> source_ref = source_ref <EOL> ) <EOL> else : <EOL> return ExpressionBuiltinNext2 ( <EOL> iterator = iterator , <EOL> default = default , <EOL> source_ref = source_ref <EOL> ) <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = selectNextBuiltinClass , <EOL> builtin_spec = BuiltinOptimization . builtin_iter_spec <EOL> ) <EOL> def dict_extractor ( node ) : <EOL> def wrapExpressionBuiltinDictCreation ( positional_args , dict_star_arg , <EOL> source_ref ) : <EOL> if len ( positional_args ) > <NUM_LIT:1> : <EOL> result = makeRaiseExceptionReplacementExpressionFromInstance ( <EOL> expression = node , <EOL> exception = TypeError ( <EOL> "<STR_LIT>" % ( <EOL> len ( positional_args ) <EOL> ) <EOL> ) <EOL> ) <EOL> result = wrapExpressionWithSideEffects ( <EOL> side_effects = positional_args , <EOL> old_node = node , <EOL> new_node = result <EOL> ) <EOL> if dict_star_arg : <EOL> result = wrapExpressionWithSideEffects ( <EOL> side_effects = dict_star_arg , <EOL> old_node = node , <EOL> new_node = result <EOL> ) <EOL> return result <EOL> return ExpressionBuiltinDict ( <EOL> pos_arg = positional_args [ <NUM_LIT:0> ] if positional_args else None , <EOL> pairs = dict_star_arg , <EOL> source_ref = source_ref <EOL> ) <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = wrapExpressionBuiltinDictCreation , <EOL> builtin_spec = BuiltinOptimization . builtin_dict_spec <EOL> ) <EOL> def chr_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinChr , <EOL> builtin_spec = BuiltinOptimization . builtin_chr_spec <EOL> ) <EOL> def ord_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinOrd , <EOL> builtin_spec = BuiltinOptimization . builtin_ord_spec , <EOL> empty_special_class = ExpressionBuiltinOrd0 <EOL> ) <EOL> def bin_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinBin , <EOL> builtin_spec = BuiltinOptimization . builtin_bin_spec <EOL> ) <EOL> def oct_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinOct , <EOL> builtin_spec = BuiltinOptimization . builtin_oct_spec <EOL> ) <EOL> def hex_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinHex , <EOL> builtin_spec = BuiltinOptimization . builtin_hex_spec <EOL> ) <EOL> def id_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinId , <EOL> builtin_spec = BuiltinOptimization . builtin_id_spec <EOL> ) <EOL> def repr_extractor ( node ) : <EOL> def makeReprOperator ( operand , source_ref ) : <EOL> return ExpressionOperationUnary ( <EOL> operator = "<STR_LIT>" , <EOL> operand = operand , <EOL> source_ref = source_ref <EOL> ) <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = makeReprOperator , <EOL> builtin_spec = BuiltinOptimization . builtin_repr_spec <EOL> ) <EOL> def range_extractor ( node ) : <EOL> def selectRangeBuiltin ( low , high , step , source_ref ) : <EOL> if high is None : <EOL> return ExpressionBuiltinRange1 ( <EOL> low = low , <EOL> source_ref = source_ref <EOL> ) <EOL> elif step is None : <EOL> return ExpressionBuiltinRange2 ( <EOL> low = low , <EOL> high = high , <EOL> source_ref = source_ref <EOL> ) <EOL> else : <EOL> return ExpressionBuiltinRange3 ( <EOL> low = low , <EOL> high = high , <EOL> step = step , <EOL> source_ref = source_ref <EOL> ) <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = selectRangeBuiltin , <EOL> builtin_spec = BuiltinOptimization . builtin_range_spec , <EOL> empty_special_class = ExpressionBuiltinRange0 <EOL> ) <EOL> if python_version < <NUM_LIT> : <EOL> from nuitka . nodes . BuiltinRangeNodes import ExpressionBuiltinXrange <EOL> def xrange_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinXrange , <EOL> builtin_spec = BuiltinOptimization . builtin_xrange_spec <EOL> ) <EOL> def len_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinLen , <EOL> builtin_spec = BuiltinOptimization . builtin_len_spec <EOL> ) <EOL> def tuple_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinTuple , <EOL> builtin_spec = BuiltinOptimization . builtin_tuple_spec <EOL> ) <EOL> def list_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinList , <EOL> builtin_spec = BuiltinOptimization . builtin_list_spec <EOL> ) <EOL> def set_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinSet , <EOL> builtin_spec = BuiltinOptimization . builtin_set_spec <EOL> ) <EOL> def float_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinFloat , <EOL> builtin_spec = BuiltinOptimization . builtin_float_spec <EOL> ) <EOL> def complex_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinComplex , <EOL> builtin_spec = BuiltinOptimization . builtin_complex_spec <EOL> ) <EOL> def str_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinStr , <EOL> builtin_spec = BuiltinOptimization . builtin_str_spec <EOL> ) <EOL> if python_version < <NUM_LIT> : <EOL> from nuitka . nodes . BuiltinTypeNodes import ExpressionBuiltinUnicode <EOL> def unicode_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinUnicode , <EOL> builtin_spec = BuiltinOptimization . builtin_unicode_spec <EOL> ) <EOL> def bool_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinBool , <EOL> builtin_spec = BuiltinOptimization . builtin_bool_spec <EOL> ) <EOL> def int_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinInt , <EOL> builtin_spec = BuiltinOptimization . builtin_int_spec <EOL> ) <EOL> if python_version < <NUM_LIT> : <EOL> from nuitka . nodes . BuiltinTypeNodes import ExpressionBuiltinLong <EOL> def long_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinLong , <EOL> builtin_spec = BuiltinOptimization . builtin_long_spec <EOL> ) <EOL> def globals_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinGlobals , <EOL> builtin_spec = BuiltinOptimization . builtin_globals_spec <EOL> ) <EOL> def locals_extractor ( node ) : <EOL> provider = node . getParentVariableProvider ( ) <EOL> if provider . isCompiledPythonModule ( ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinGlobals , <EOL> builtin_spec = BuiltinOptimization . builtin_globals_spec <EOL> ) <EOL> else : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinLocals , <EOL> builtin_spec = BuiltinOptimization . builtin_locals_spec <EOL> ) <EOL> if python_version < <NUM_LIT> : <EOL> from nuitka . nodes . ExecEvalNodes import ExpressionBuiltinExecfile <EOL> def execfile_extractor ( node ) : <EOL> @ calledWithBuiltinArgumentNamesDecorator <EOL> def wrapExpressionBuiltinExecfileCreation ( filename , globals_arg , <EOL> locals_arg , source_ref ) : <EOL> outline_body = ExpressionOutlineBody ( <EOL> provider = node . getParentVariableProvider ( ) , <EOL> name = "<STR_LIT>" , <EOL> source_ref = source_ref <EOL> ) <EOL> globals_ref , locals_ref , tried , final = wrapEvalGlobalsAndLocals ( <EOL> provider = node . getParentVariableProvider ( ) , <EOL> globals_node = globals_arg , <EOL> locals_node = locals_arg , <EOL> temp_scope = outline_body . getOutlineTempScope ( ) , <EOL> source_ref = source_ref <EOL> ) <EOL> tried = makeStatementsSequence ( <EOL> statements = ( <EOL> tried , <EOL> StatementReturn ( <EOL> expression = ExpressionBuiltinExecfile ( <EOL> source_code = ExpressionCallEmpty ( <EOL> called = ExpressionAttributeLookup ( <EOL> source = ExpressionBuiltinOpen ( <EOL> filename = filename , <EOL> mode = ExpressionConstantRef ( <EOL> constant = "<STR_LIT>" , <EOL> source_ref = source_ref <EOL> ) , <EOL> buffering = None , <EOL> source_ref = source_ref <EOL> ) , <EOL> attribute_name = "<STR_LIT>" , <EOL> source_ref = source_ref <EOL> ) , <EOL> source_ref = source_ref <EOL> ) , <EOL> globals_arg = globals_ref , <EOL> locals_arg = locals_ref , <EOL> source_ref = source_ref <EOL> ) , <EOL> source_ref = source_ref <EOL> ) <EOL> ) , <EOL> allow_none = False , <EOL> source_ref = source_ref <EOL> ) <EOL> outline_body . setBody ( <EOL> makeStatementsSequenceFromStatement ( <EOL> statement = makeTryFinallyStatement ( <EOL> provider = outline_body , <EOL> tried = tried , <EOL> final = final , <EOL> source_ref = source_ref <EOL> ) <EOL> ) <EOL> ) <EOL> return outline_body <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = wrapExpressionBuiltinExecfileCreation , <EOL> builtin_spec = BuiltinOptimization . builtin_execfile_spec <EOL> ) <EOL> def eval_extractor ( node ) : <EOL> @ calledWithBuiltinArgumentNamesDecorator <EOL> def wrapEvalBuiltin ( source , globals_arg , locals_arg , source_ref ) : <EOL> provider = node . getParentVariableProvider ( ) <EOL> outline_body = ExpressionOutlineBody ( <EOL> provider = node . getParentVariableProvider ( ) , <EOL> name = "<STR_LIT>" , <EOL> source_ref = source_ref <EOL> ) <EOL> globals_ref , locals_ref , tried , final = wrapEvalGlobalsAndLocals ( <EOL> provider = provider , <EOL> globals_node = globals_arg , <EOL> locals_node = locals_arg , <EOL> temp_scope = outline_body . getOutlineTempScope ( ) , <EOL> source_ref = source_ref <EOL> ) <EOL> assert globals_arg is None or globals_ref . getSourceReference ( ) == globals_arg . getSourceReference ( ) <EOL> assert locals_arg is None or locals_ref . getSourceReference ( ) == locals_arg . getSourceReference ( ) <EOL> source_variable = outline_body . allocateTempVariable ( <EOL> temp_scope = None , <EOL> name = "<STR_LIT:source>" <EOL> ) <EOL> final . setStatements ( <EOL> final . getStatements ( ) + ( <EOL> StatementDelVariable ( <EOL> variable_ref = ExpressionTargetTempVariableRef ( <EOL> variable = source_variable , <EOL> source_ref = source_ref <EOL> ) , <EOL> tolerant = True , <EOL> source_ref = source_ref <EOL> ) , <EOL> ) <EOL> ) <EOL> strip_choice = ExpressionConstantRef ( <EOL> constant = ( "<STR_LIT>" , ) , <EOL> source_ref = source_ref <EOL> ) <EOL> if python_version >= <NUM_LIT> : <EOL> strip_choice = ExpressionConditional ( <EOL> condition = ExpressionComparisonIs ( <EOL> left = ExpressionBuiltinType1 ( <EOL> value = ExpressionTempVariableRef ( <EOL> variable = source_variable , <EOL> source_ref = source_ref <EOL> ) , <EOL> source_ref = source_ref <EOL> ) , <EOL> right = ExpressionBuiltinRef ( <EOL> builtin_name = "<STR_LIT>" , <EOL> source_ref = source_ref <EOL> ) , <EOL> source_ref = source_ref <EOL> ) , <EOL> expression_yes = ExpressionConstantRef ( <EOL> constant = ( b"<STR_LIT>" , ) , <EOL> source_ref = source_ref <EOL> ) , <EOL> expression_no = strip_choice , <EOL> source_ref = source_ref <EOL> ) <EOL> string_fixup = [ <EOL> StatementAssignmentVariable ( <EOL> variable_ref = ExpressionTargetTempVariableRef ( <EOL> variable = source_variable , <EOL> source_ref = source_ref <EOL> ) , <EOL> source = ExpressionCallNoKeywords ( <EOL> called = ExpressionAttributeLookup ( <EOL> source = ExpressionTempVariableRef ( <EOL> variable = source_variable , <EOL> source_ref = source_ref <EOL> ) , <EOL> attribute_name = "<STR_LIT>" , <EOL> source_ref = source_ref <EOL> ) , <EOL> args = strip_choice , <EOL> source_ref = source_ref <EOL> ) , <EOL> source_ref = source_ref <EOL> ) <EOL> ] <EOL> statements = ( <EOL> StatementAssignmentVariable ( <EOL> variable_ref = ExpressionTargetTempVariableRef ( <EOL> variable = source_variable , <EOL> source_ref = source_ref <EOL> ) , <EOL> source = source , <EOL> source_ref = source_ref , <EOL> ) , <EOL> StatementConditional ( <EOL> condition = ExpressionOperationNOT ( <EOL> operand = ExpressionBuiltinIsinstance ( <EOL> instance = ExpressionTempVariableRef ( <EOL> variable = source_variable , <EOL> source_ref = source_ref <EOL> ) , <EOL> classes = ExpressionBuiltinAnonymousRef ( <EOL> builtin_name = "<STR_LIT:code>" , <EOL> source_ref = source_ref , <EOL> ) , <EOL> source_ref = source_ref <EOL> ) , <EOL> source_ref = source_ref <EOL> ) , <EOL> yes_branch = StatementsSequence ( <EOL> statements = string_fixup , <EOL> source_ref = source_ref <EOL> ) , <EOL> no_branch = None , <EOL> source_ref = source_ref <EOL> ) , <EOL> StatementReturn ( <EOL> expression = ExpressionBuiltinEval ( <EOL> source_code = ExpressionTempVariableRef ( <EOL> variable = source_variable , <EOL> source_ref = source_ref <EOL> ) , <EOL> globals_arg = globals_ref , <EOL> locals_arg = locals_ref , <EOL> source_ref = source_ref <EOL> ) , <EOL> source_ref = source_ref <EOL> ) <EOL> ) <EOL> tried = makeStatementsSequence ( <EOL> statements = ( <EOL> tried , <EOL> ) + statements , <EOL> allow_none = False , <EOL> source_ref = source_ref <EOL> ) <EOL> outline_body . setBody ( <EOL> makeStatementsSequenceFromStatement ( <EOL> statement = makeTryFinallyStatement ( <EOL> provider = outline_body , <EOL> tried = tried , <EOL> final = final , <EOL> source_ref = source_ref <EOL> ) <EOL> ) <EOL> ) <EOL> return outline_body <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = wrapEvalBuiltin , <EOL> builtin_spec = BuiltinOptimization . builtin_eval_spec <EOL> ) <EOL> if python_version >= <NUM_LIT> : <EOL> from nuitka . nodes . ExecEvalNodes import ExpressionBuiltinExec <EOL> def exec_extractor ( node ) : <EOL> @ calledWithBuiltinArgumentNamesDecorator <EOL> def wrapExpressionBuiltinExecCreation ( source , globals_arg , locals_arg , <EOL> source_ref ) : <EOL> provider = node . getParentVariableProvider ( ) <EOL> outline_body = ExpressionOutlineBody ( <EOL> provider = provider , <EOL> name = "<STR_LIT>" , <EOL> source_ref = source_ref <EOL> ) <EOL> globals_ref , locals_ref , tried , final = wrapEvalGlobalsAndLocals ( <EOL> provider = provider , <EOL> globals_node = globals_arg , <EOL> locals_node = locals_arg , <EOL> temp_scope = outline_body . getOutlineTempScope ( ) , <EOL> source_ref = source_ref <EOL> ) <EOL> tried = makeStatementsSequence ( <EOL> statements = ( <EOL> tried , <EOL> StatementReturn ( <EOL> expression = ExpressionBuiltinExec ( <EOL> source_code = source , <EOL> globals_arg = globals_ref , <EOL> locals_arg = locals_ref , <EOL> source_ref = source_ref <EOL> ) , <EOL> source_ref = source_ref <EOL> ) , <EOL> ) , <EOL> allow_none = False , <EOL> source_ref = source_ref <EOL> ) <EOL> tried . parent = outline_body <EOL> outline_body . setBody ( <EOL> makeStatementsSequenceFromStatement ( <EOL> statement = makeTryFinallyStatement ( <EOL> provider = provider , <EOL> tried = tried , <EOL> final = final , <EOL> source_ref = source_ref <EOL> ) <EOL> ) <EOL> ) <EOL> return outline_body <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = wrapExpressionBuiltinExecCreation , <EOL> builtin_spec = BuiltinOptimization . builtin_eval_spec <EOL> ) <EOL> def compile_extractor ( node ) : <EOL> def wrapExpressionBuiltinCompileCreation ( source_code , filename , mode , flags , <EOL> dont_inherit , optimize = None , <EOL> source_ref = None ) : <EOL> return ExpressionBuiltinCompile ( <EOL> source_code = source_code , <EOL> filename = filename , <EOL> mode = mode , <EOL> flags = flags , <EOL> dont_inherit = dont_inherit , <EOL> optimize = optimize , <EOL> source_ref = source_ref <EOL> ) <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = wrapExpressionBuiltinCompileCreation , <EOL> builtin_spec = BuiltinOptimization . builtin_compile_spec <EOL> ) <EOL> def open_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinOpen , <EOL> builtin_spec = BuiltinOptimization . builtin_open_spec <EOL> ) <EOL> def super_extractor ( node ) : <EOL> @ calledWithBuiltinArgumentNamesDecorator <EOL> def wrapSuperBuiltin ( type_arg , object_arg , source_ref ) : <EOL> if type_arg is None and python_version >= <NUM_LIT> : <EOL> provider = node . getParentVariableProvider ( ) <EOL> type_arg = ExpressionVariableRef ( <EOL> variable_name = "<STR_LIT>" , <EOL> source_ref = source_ref <EOL> ) <EOL> type_arg . setVariable ( <EOL> provider . getVariableForReference ( <EOL> variable_name = "<STR_LIT>" <EOL> ) <EOL> ) <EOL> type_arg_owner = type_arg . getVariable ( ) . getOwner ( ) <EOL> if type_arg_owner is provider or not ( type_arg_owner . isExpressionFunctionBody ( ) or type_arg_owner . isExpressionClassBody ( ) ) : <EOL> type_arg = None <EOL> else : <EOL> addVariableUsage ( type_arg . getVariable ( ) , provider ) <EOL> if type_arg is None : <EOL> return makeRaiseExceptionReplacementExpression ( <EOL> expression = node , <EOL> exception_type = "<STR_LIT>" <EOL> if python_version < <NUM_LIT> else <EOL> "<STR_LIT>" , <EOL> exception_value = "<STR_LIT>" , <EOL> ) <EOL> if object_arg is None : <EOL> if provider . isExpressionGeneratorObjectBody ( ) : <EOL> parameter_provider = provider . getParentVariableProvider ( ) <EOL> else : <EOL> parameter_provider = provider <EOL> if parameter_provider . getParameters ( ) . getArgumentCount ( ) > <NUM_LIT:0> : <EOL> par1_name = parameter_provider . getParameters ( ) . getArgumentNames ( ) [ <NUM_LIT:0> ] <EOL> object_arg = ExpressionVariableRef ( <EOL> variable_name = par1_name , <EOL> source_ref = source_ref <EOL> ) <EOL> object_arg . setVariable ( <EOL> provider . getVariableForReference ( <EOL> variable_name = par1_name <EOL> ) <EOL> ) <EOL> if not object_arg . getVariable ( ) . isParameterVariable ( ) : <EOL> return makeRaiseExceptionReplacementExpression ( <EOL> expression = node , <EOL> exception_type = "<STR_LIT>" <EOL> if python_version < <NUM_LIT> else <EOL> "<STR_LIT>" , <EOL> exception_value = "<STR_LIT>" , <EOL> ) <EOL> else : <EOL> return makeRaiseExceptionReplacementExpression ( <EOL> expression = node , <EOL> exception_type = "<STR_LIT>" , <EOL> exception_value = "<STR_LIT>" <EOL> ) <EOL> return ExpressionBuiltinSuper ( <EOL> super_type = type_arg , <EOL> super_object = object_arg , <EOL> source_ref = source_ref <EOL> ) <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = wrapSuperBuiltin , <EOL> builtin_spec = BuiltinOptimization . builtin_super_spec <EOL> ) <EOL> def hasattr_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinHasattr , <EOL> builtin_spec = BuiltinOptimization . builtin_hasattr_spec <EOL> ) <EOL> def getattr_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinGetattr , <EOL> builtin_spec = BuiltinOptimization . builtin_getattr_spec <EOL> ) <EOL> def setattr_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinSetattr , <EOL> builtin_spec = BuiltinOptimization . builtin_setattr_spec <EOL> ) <EOL> def isinstance_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinIsinstance , <EOL> builtin_spec = BuiltinOptimization . builtin_isinstance_spec <EOL> ) <EOL> def bytearray_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinBytearray , <EOL> builtin_spec = BuiltinOptimization . builtin_bytearray_spec <EOL> ) <EOL> def slice_extractor ( node ) : <EOL> def wrapSlice ( start , stop , step , source_ref ) : <EOL> if start is not None and stop is None : <EOL> stop = start <EOL> start = None <EOL> return ExpressionBuiltinSlice ( <EOL> start = start , <EOL> stop = stop , <EOL> step = step , <EOL> source_ref = source_ref <EOL> ) <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = wrapSlice , <EOL> builtin_spec = BuiltinOptimization . builtin_slice_spec <EOL> ) <EOL> def hash_extractor ( node ) : <EOL> return BuiltinOptimization . extractBuiltinArgs ( <EOL> node = node , <EOL> builtin_class = ExpressionBuiltinHash , <EOL> builtin_spec = BuiltinOptimization . builtin_hash_spec <EOL> ) <EOL> _dispatch_dict = { <EOL> "<STR_LIT>" : compile_extractor , <EOL> "<STR_LIT>" : globals_extractor , <EOL> "<STR_LIT>" : locals_extractor , <EOL> "<STR_LIT>" : eval_extractor , <EOL> "<STR_LIT>" : dir_extractor , <EOL> "<STR_LIT>" : vars_extractor , <EOL> "<STR_LIT>" : import_extractor , <EOL> "<STR_LIT>" : chr_extractor , <EOL> "<STR_LIT>" : ord_extractor , <EOL> "<STR_LIT>" : bin_extractor , <EOL> "<STR_LIT>" : oct_extractor , <EOL> "<STR_LIT>" : hex_extractor , <EOL> "<STR_LIT:id>" : id_extractor , <EOL> "<STR_LIT:type>" : type_extractor , <EOL> "<STR_LIT>" : iter_extractor , <EOL> "<STR_LIT>" : next_extractor , <EOL> "<STR_LIT>" : range_extractor , <EOL> "<STR_LIT>" : tuple_extractor , <EOL> "<STR_LIT:list>" : list_extractor , <EOL> "<STR_LIT>" : dict_extractor , <EOL> "<STR_LIT>" : set_extractor , <EOL> "<STR_LIT:float>" : float_extractor , <EOL> "<STR_LIT>" : complex_extractor , <EOL> "<STR_LIT:str>" : str_extractor , <EOL> "<STR_LIT:bool>" : bool_extractor , <EOL> "<STR_LIT:int>" : int_extractor , <EOL> "<STR_LIT>" : repr_extractor , <EOL> "<STR_LIT>" : len_extractor , <EOL> "<STR_LIT>" : super_extractor , <EOL> "<STR_LIT>" : hasattr_extractor , <EOL> "<STR_LIT>" : getattr_extractor , <EOL> "<STR_LIT>" : setattr_extractor , <EOL> "<STR_LIT>" : isinstance_extractor , <EOL> "<STR_LIT>" : slice_extractor , <EOL> "<STR_LIT>" : hash_extractor <EOL> } <EOL> if python_version < <NUM_LIT> : <EOL> _dispatch_dict [ "<STR_LIT>" ] = long_extractor <EOL> _dispatch_dict [ "<STR_LIT>" ] = unicode_extractor <EOL> _dispatch_dict [ "<STR_LIT>" ] = execfile_extractor <EOL> _dispatch_dict [ "<STR_LIT>" ] = open_extractor <EOL> else : <EOL> _dispatch_dict [ "<STR_LIT>" ] = exec_extractor <EOL> def check ( ) : <EOL> from nuitka . Builtins import builtin_names <EOL> for builtin_name in _dispatch_dict : <EOL> assert builtin_name in builtin_names , builtin_name <EOL> check ( ) <EOL> _builtin_white_list = ( <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> ) <EOL> def computeBuiltinCall ( call_node , called ) : <EOL> builtin_name = called . getBuiltinName ( ) <EOL> if builtin_name in _dispatch_dict : <EOL> new_node = _dispatch_dict [ builtin_name ] ( call_node ) <EOL> assert new_node is not call_node <EOL> if new_node is None : <EOL> return call_node , None , None <EOL> inspect_node = new_node <EOL> if inspect_node . isExpressionSideEffects ( ) : <EOL> inspect_node = inspect_node . getExpression ( ) <EOL> if inspect_node . isExpressionBuiltinImport ( ) : <EOL> tags = "<STR_LIT>" <EOL> message = """<STR_LIT>""" % ( <EOL> inspect_node . kind , <EOL> ) <EOL> elif inspect_node . isExpressionBuiltin ( ) or inspect_node . isStatementExec ( ) : <EOL> tags = "<STR_LIT>" <EOL> message = "<STR_LIT>" % ( <EOL> builtin_name , <EOL> inspect_node . kind , <EOL> ) <EOL> elif inspect_node . isExpressionRaiseException ( ) : <EOL> tags = "<STR_LIT>" <EOL> message = """<STR_LIT>""" % ( <EOL> inspect_node . kind , <EOL> ) <EOL> elif inspect_node . isExpressionOperationUnary ( ) : <EOL> tags = "<STR_LIT>" <EOL> message = """<STR_LIT>""" % ( <EOL> inspect_node . kind , <EOL> inspect_node . getOperator ( ) <EOL> ) <EOL> elif inspect_node . isExpressionCall ( ) : <EOL> tags = "<STR_LIT>" <EOL> message = """<STR_LIT>""" % ( <EOL> inspect_node . kind , <EOL> ) <EOL> elif inspect_node . isExpressionOutlineBody ( ) : <EOL> tags = "<STR_LIT>" <EOL> message = """<STR_LIT>""" % builtin_name <EOL> else : <EOL> assert False , ( builtin_name , "<STR_LIT>" , inspect_node ) <EOL> if False and isDebug ( ) and not shallMakeModule ( ) and builtin_name : <EOL> source_ref = called . getSourceReference ( ) <EOL> new_node = ExpressionConditional ( <EOL> condition = ExpressionComparisonIs ( <EOL> left = ExpressionBuiltinRef ( <EOL> builtin_name = builtin_name , <EOL> source_ref = source_ref <EOL> ) , <EOL> right = ExpressionBuiltinOriginalRef ( <EOL> builtin_name = builtin_name , <EOL> source_ref = source_ref <EOL> ) , <EOL> source_ref = source_ref <EOL> ) , <EOL> expression_yes = new_node , <EOL> expression_no = makeRaiseExceptionReplacementExpression ( <EOL> exception_type = "<STR_LIT>" , <EOL> exception_value = "<STR_LIT>" % ( <EOL> builtin_name <EOL> ) , <EOL> expression = call_node <EOL> ) , <EOL> source_ref = source_ref <EOL> ) <EOL> assert tags != "<STR_LIT>" <EOL> return new_node , tags , message <EOL> else : <EOL> if False and isDebug ( ) and builtin_name not in _builtin_white_list : <EOL> warning ( <EOL> "<STR_LIT>" % builtin_name <EOL> ) <EOL> return call_node , None , None </s>
