def _Apply(self, appl):
        fn = appl.function()
        if isinstance(fn, S.Closure):
            fn_name = fn.body().id
        else:
            fn_name = fn.id
        if self.procedures in fn_name:
            instantiatedFunction = self.procedures[fn_name]
            functionArguments = instantiatedFunction.variables[1:]
            instantiatedArguments = appl.parameters[1:]
            if isinstance(fn, S.Closure):
                instantiatedArguments.extend(fn.variables)
            env = pltools.Environment()
            for (internal, external) in zip(functionArguments, instantiatedArguments):
                env[internal.id] = external
            return_finder = ReturnFinder()
            return_finder.visit(instantiatedFunction)
            #XXX HACK. Need to do conditional statement->expression conversion
            # In order to make inlining possible
            if return_finder.return_in_conditional:
                return appl
            env[return_finder.return_value.id] = self.activeBinding
            statements = filter(lambda x: not isinstance(x, S.Return),
                                instantiatedFunction.body())
            statements = [S.substituted_expression(x, env) for x in \
                              statements]
            singleAssignmentInstantiation = single_assignment_conversion(statements, exceptions=set((x.id for x in flatten(self.activeBinding))), M=self.M)
            self.statements = singleAssignmentInstantiation
            return None
        return appl
dataset/ETHPy150Open bryancatanzaro/copperhead/copperhead/compiler/rewrites.py/FunctionInliner._Apply/swapped operands of `in`