<commit_before>import cerbas
import json


def request(func, user, source, arguments=None, msgpack=False):
    if arguments:
        v = json.loads(cerbas.request(func=func, user=user, source=source, arguments=arguments, msgpack=msgpack))
    else:
        v = json.loads(cerbas.request(func=func, user=user, source=source, msgpack=msgpack))
    return v


def test():
    prod, local = False, True
    cerbas.start(prod, local)
    source = "cerbastest"
    print request(func="hello", user="foo", source=source, msgpack=True)
    print request(func="hello", user="foo", source=source)
    print request(func="slow", user="foo", source=source)
    print request(func="halt", user="foo", source=source, arguments=dict(delay=1000))

if __name__ == "__main__":
    test()<commit_msg>minor change to cerbastest.py<commit_after>import cerbas
import json


def request(func, user, source, arguments=None, msgpack=False):
    if arguments:
        v = json.loads(cerbas.request(func=func, user=user, source=source, arguments=arguments, msgpack=msgpack))
    else:
        v = json.loads(cerbas.request(func=func, user=user, source=source, msgpack=msgpack))
    return v


def test():
    prod, local = False, True
    cerbas.start(prod, local)
    source = "cerbastest"
    print( request(func="hello", user="foo", source=source, msgpack=True))
    print( request(func="hello", user="foo", source=source))
    print( request(func="slow", user="foo", source=source))
    print( request(func="halt", user="foo", source=source, arguments=dict(delay=1000)))

if __name__ == "__main__":
    test()
{'fraction_non_alphanumeric': 0.15069356872635561, 'fraction_numerical': 0.005044136191677175, 'mean_word_length': 4.899628252788104, 'pattern_counts': {'":': 2, '<': 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': '6017492', 'n_tokens_mistral': 511, 'n_tokens_neox': 503, 'n_words': 118}