<commit_before>from redis import Redis
from app import app, router

@router.node(['word'], entry_point=True)
def emit_words(msg):
    for word in msg.document.strip().split(' '):
        yield word

@router.node(['word', 'count'], subscribe_to='tasks.emit_words', celery_task=app.task(rate_limit='5/s'))
def tally_word(msg):
    redis = Redis()
    return msg.word, redis.zincrby('celery_emit_example', msg.word, 1)<commit_msg>change list to tuples in celery example<commit_after>from redis import Redis
from app import app, router

@router.node(('word',), entry_point=True)
def emit_words(msg):
    for word in msg.document.strip().split(' '):
        yield word

@router.node(('word', 'count'), subscribe_to='tasks.emit_words', celery_task=app.task(rate_limit='5/s'))
def tally_word(msg):
    redis = Redis()
    return msg.word, redis.zincrby('celery_emit_example', msg.word, 1)
{'fraction_non_alphanumeric': 0.15550510783200908, 'fraction_numerical': 0.004540295119182747, 'mean_word_length': 5.345323741007194, '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': '2816155', 'n_tokens_mistral': 310, 'n_tokens_neox': 299, 'n_words': 69}