def __init__(self, func, scopes, isLambda, class_name, mod):
        self.scopes = scopes
        self.scope = scopes[func]
        self.class_name = class_name
        self.module = mod
        if isLambda:
            klass = FunctionCodeGenerator
            name = "<lambda.%d>" % klass.lambdaCount
            klass.lambdaCount = klass.lambdaCount + 1
        else:
            name = func.name
        args, hasTupleArg = pycodegen.generateArgList(func.argnames)
        self.optimized = int(name!='__code__')
        self._special_locals = name=='__code__'
        self.graph = pyassem.PyFlowGraph(name, func.filename, args,
                                         optimized=self.optimized)
        if name=='__code__': self.graph.setFlag(consts.CO_NEWLOCALS)
        self.isLambda = isLambda
        self.super_init()

        if not isLambda and func.doc:
            self.setDocstring(func.doc)

        lnf = pycodegen.walk(func.code, self.NameFinder(args), verbose=0)
        self.locals.push(lnf.getLocals())
        if func.varargs:
            self.graph.setFlag(consts.CO_VARARGS)
        if func.kwargs:
            self.graph.setFlag(consts.CO_VARKEYWORDS)
        self.set_lineno(func)
        if hasTupleArg:
            self.generateArgUnpack(func.argnames)
        self.graph.setFreeVars(self.scope.get_free_vars())
        self.graph.setCellVars(self.scope.get_cell_vars())
        if self.scope.generator is not None:
            self.graph.setFlag(pycodegen.CO_GENERATOR)
dataset/ETHPy150Open CGATOxford/cgat/obsolete/preppy.py/_preppy_FunctionCodeGenerator.__init__/original