def check_expr(expr,local_vars,global_vars={}):
values = {}<EOL>for var,val in global_vars.items():<EOL><INDENT>if isinstance(val, ndarray):<EOL><INDENT>values[var] = dummy_array(val,name=var)<EOL><DEDENT>elif isnumeric(val):<EOL><INDENT>values[var] = val<EOL><DEDENT><DEDENT>for var,val in local_vars.items():<EOL><INDENT>if isinstance(val, ndarray):<EOL><INDENT>values[var] = dummy_array(val,name=var)<EOL><DEDENT>if isnumeric(val):<EOL><INDENT>values[var] = val<EOL><DEDENT><DEDENT>exec(expr,values)<EOL>try:<EOL><INDENT>exec(expr,values)<EOL><DEDENT>except:<EOL><INDENT>try:<EOL><INDENT>eval(expr,values)<EOL><DEDENT>except:<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT><DEDENT>return <NUM_LIT:1><EOL>
Currently only checks expressions (not suites).
        Doesn't check that lhs = rhs. checked by compiled func though