def exprify(expr, dtypes):
    scope = merge(safe_scope, math_operators)

    # use eval mode to raise a SyntaxError if any statements are passed in
    parsed = ast.parse(expr, mode='eval')
    overlapping_names = set(dtypes) & set(scope)
    if overlapping_names:
        raise ValueError('overlapping names %s' % overlapping_names)
    parser = BlazeParser(dtypes, scope)
    return parser.visit(parsed.body)
Transform xfsrestore inventory data output to a Python dict source and evaluate it.
dataset/ETHPy150Open blaze/blaze/blaze/expr/parser.py/exprify--crossover with--dataset/ETHPy150Open saltstack/salt/salt/modules/xfs.py/_xfs_inventory_output