def make(self, src_templ, evaldict=None, addsource=False, **attrs):
        src = src_templ % vars(self) # expand name and signature
        evaldict = evaldict or {}
        mo = FunctionMaker.DEF.match(src)
        if mo is None:
            raise SyntaxError('not a valid function template\n%s' % src)
        name = mo.group(1) # extract the function name
        reserved_names = set([name] + [
            arg.strip(' *') for arg in self.signature.split(',')])
        for n, v in evaldict.iteritems():
            if n in reserved_names:
                raise NameError('%s is overridden in\n%s' % (n, src))
        if not src.endswith('\n'): # add a newline just for safety
            src += '\n'
        try:
            code = compile(src, '<string>', 'single')
            exec code in evaldict
        except:
            print >> sys.stderr, 'Error in generated code:'
            print >> sys.stderr, src
            raise
        func = evaldict[name]
        if addsource:
            attrs['__source__'] = src
        self.update(func, **attrs)
        return func
Make a new function from a given template and update the signature
dataset/ETHPy150Open olt/scriptine/scriptine/misc.py/FunctionMaker.make