<commit_before>from autobahn.twisted import run


def on_join(session):
    print('session connected: {}'.format(session))
    session.leave()


def main(connection):
    connection.session.on_join(on_join)


if __name__ == '__main__':
    return run(main)<commit_msg>polish up<commit_after>from twisted.internet.defer import inlineCallbacks as coroutine
from autobahn.twisted import run

@coroutine
def on_join(session):
    # the session has joined the realm and the full range of
    # WAMP interactions are now possible
    try:
        res = yield session.call(u'com.example.add2', 2, 3)
        print("Result: {}".format(res))
    except Exception as e:
        print("Error: {}".format(e))
    finally:
        session.leave()

def main(connection):
    # this is hooking into a session event, but that is
    # replicated on as a connection event
    connection.on_join(on_join)

if __name__ == '__main__':
    # this is using the defaults: WAMP-over-WebSocket
    # to "ws://127.0.0.1:8080/ws" and realm "public"
    return run(main)
{'fraction_non_alphanumeric': 0.11036468330134357, 'fraction_numerical': 0.012476007677543186, 'mean_word_length': 3.515151515151515, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '1999999', 'n_tokens_mistral': 336, 'n_tokens_neox': 326, 'n_words': 98}