How to use the asteval.asteval.Procedure function in asteval

To help you get started, we’ve selected a few asteval examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github newville / asteval / asteval / View on Github external
kwargs.append((keyval, defval))

        args = [tnode.arg for tnode in node.args.args[:offset]]
        doc = None
        nb0 = node.body[0]
        if isinstance(nb0, ast.Expr) and isinstance(nb0.value, ast.Str):
            doc = nb0.value.s

        varkws = node.args.kwarg
        vararg = node.args.vararg
        if isinstance(vararg, ast.arg):
            vararg = vararg.arg
        if isinstance(varkws, ast.arg):
            varkws = varkws.arg

        self.symtable[] = Procedure(, self, doc=doc,
                                             args=args, kwargs=kwargs,
                                             vararg=vararg, varkws=varkws)
        if in self.no_deepcopy: