<commit_before>from taskin import task
import subprocess


def foo(input):
    return 1


def check(v):
    return v == 1


def bar(input):
    return 'bar'


def baz(input):
    return 'baz'


def finish(input):
    print('done: %s' % input)
    return input


def dig_it(input):
    input, zone = input
    cmd = 'dig +short %s' % zone
    print(cmd)
    ip = subprocess.check_output(cmd, shell=True).strip()
    return (input, ip)


myflow = [
    foo,
    task.IfTask(check, [bar], [baz]),
    task.MapTask([
        'ionrock.org',
        'google.com',
        'rackspace.com',
    ], dig_it),
    finish,
]


def main():
    print(task.do_flow(myflow))


if __name__ == '__main__':

    main()<commit_msg>s/input/data and improve example<commit_after>from taskin import task
import subprocess


def foo(data):
    return 1


def check(v):
    return v == 1


def bar(data):
    return 'bar'


def baz(data):
    return 'baz'


def finish(data):
    for i in data:
        print('%s, %s' % i)
    print('Done!')

    return data


def dig_it(data):
    data, zone = data
    cmd = 'dig +short %s' % zone
    print('running: %s' % cmd.strip())

    ip = subprocess.check_output(cmd.split()).strip()
    return (data, ip)


myflow = [
    foo,
    task.IfTask(check, [bar], [baz]),
    task.MapTask([
        'ionrock.org',
        'google.com',
        'rackspace.com',
    ], dig_it),
    finish,
]


def main():
    print(task.do_flow(myflow))


if __name__ == '__main__':

    main()
{'fraction_non_alphanumeric': 0.15302013422818792, 'fraction_numerical': 0.0026845637583892616, 'mean_word_length': 2.508235294117647, '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': '4284214', 'n_tokens_mistral': 571, 'n_tokens_neox': 538, 'n_words': 138}