<commit_before>from Queue import Empty
import cStringIO
import parser

import processer

p=processer.processer

def Eval(obj):
    if isinstance(obj, (str, unicode)):
        obj = cStringIO.StringIO(obj)
    ast = parser.Parser(obj).ast
    try:
        ret = p._process(ast)
    except Empty as e:
        ret = e.ret
    return ret

def Exec(ast):
    try:
        ret = p._process(ast)
    except Empty as e:
        ret = e.ret
    return ret<commit_msg>Made eval non-destructive of ast<commit_after>from Queue import Empty
import cStringIO
import parser

import processer
import utils
p=processer.processer

def Eval(obj):
    if isinstance(obj, (str, unicode)):
        obj = cStringIO.StringIO(obj)
    ast = parser.Parser(obj).ast
    try:
        ret = p._process(ast)
    except Empty as e:
        ret = e.ret
    return ret

def Exec(ast):
    try:
        ret = p._process(utils.deepcopy(ast))
    except Empty as e:
        ret = e.ret
    return ret
{'fraction_non_alphanumeric': 0.09326424870466321, 'fraction_numerical': 0.0, 'mean_word_length': 2.5, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5236559', 'n_tokens_mistral': 325, 'n_tokens_neox': 313, 'n_words': 95}