How to use the asteval.astutils.NameFinder 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
def get_ast_names(astnode):
    """Return symbol Names from an AST node."""
    finder = NameFinder()
    return finder.names
github lmfit / lmfit-py / lmfit / ui / View on Github external
def model(self, value):
        if callable(value):
            model = value()
            model = value
        self._model = model
        self.current_result = None
        self._current_params = model.make_params()

        # Use these to evaluate any Parameters that use expressions.
        self.asteval = Interpreter()
        self.namefinder = NameFinder()