def parse(source, mode='exec', **opts):
    from pyast import expression_from_text, statement_from_text
    if mode is 'exec':
        return statement_from_text(source)
    elif mode is 'eval':
        return expression_from_text(source)
    else:
        raise ValueError, "illegal parsing mode (%s)" % mode
Convert string containing Copperhead code to an AST
dataset/ETHPy150Open bryancatanzaro/copperhead/copperhead/compiler/passes.py/parse