<commit_before>#!/usr/bin/env python

import redis
import json
import sys
import os
import pynotify as notify

if __name__ == '__main__':
    notify.init("notistream")

    if len(sys.argv) < 2:
        f = open(os.path.expanduser('~/.notistream.json'))
    else:
        f = open(sys.argv[1])

    config = json.load(f)

    r = redis.StrictRedis(host=config['host'], port=config['port'])
    ps = r.pubsub()
    ps.subscribe(config['channels'])

    for msg in ps.listen():
        if msg['type'] == 'message':
            n = notify.Notification(msg['data'])
            n.show()
<commit_msg>use a separate main method in client.py<commit_after>#!/usr/bin/env python

import redis
import json
import sys
import os
import pynotify as notify

def main():
    notify.init("notistream")

    if len(sys.argv) < 2:
        f = open(os.path.expanduser('~/.notistream.json'))
    else:
        f = open(sys.argv[1])

    config = json.load(f)

    r = redis.StrictRedis(host=config['host'], port=config['port'])
    ps = r.pubsub()
    ps.subscribe(config['channels'])

    for msg in ps.listen():
        if msg['type'] == 'message':
            n = notify.Notification(msg['data'])
            n.show()

if __name__ == '__main__':
    main()
{'fraction_non_alphanumeric': 0.16142050040355124, 'fraction_numerical': 0.003228410008071025, 'mean_word_length': 2.768996960486322, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7343244', 'n_tokens_mistral': 431, 'n_tokens_neox': 418, 'n_words': 97}