def ast_eval(node):
    if isinstance(node, (ast.List, ast.Tuple)):
        return map(ast_eval, node.elts)
    elif isinstance(node, ast.Str):
        return node.s
    elif isinstance(node, ast.Num):
        return node.n
    else:
        raise ValueError("Don't know how to eval %s" % node.__class__.__name__)
dataset/ETHPy150Open Suor/flaws/flaws/asttools.py/ast_eval/original