<commit_before>
import os
import sys

from . import cli
from . import master
from . import slave
from . import slave_file
from . import task

parser = cli.parser(
    description="cat a file from a specific task"
)

parser.add_argument(
    'task', type=str,
    help="ID of the task. Must match a specific task."
)

parser.add_argument(
    'file', type=str, nargs="?", default="stdout",
    help="Path to the file inside the task's sandbox."
)

def main():
    cfg, args, m = cli.init(parser)

    t = master.task(m, args.task)
    s = master.slave(m, t["slave_id"])
    p = os.path.join(task.directory(m, t), args.file)

    for chunk in slave_file.SlaveFile(s, p):
        print chunk<commit_msg>Matching normal cat multi-file operation<commit_after>
import os
import sys

from . import cli
from . import master
from . import slave
from . import slave_file
from . import task

parser = cli.parser(
    description="concatenate and print files"
)

parser.add_argument(
    'task',
    help="ID of the task. May match multiple tasks (or all)"
)

parser.add_argument(
    'file', type=str, nargs="*", default=["stdout"],
    help="Path to the file inside the task's sandbox."
)

def main():
    cfg, args, m = cli.init(parser)

    for t in master.tasks(m, args.task):
        s = master.slave(m, t["slave_id"])
        d = task.directory(m, t)
        for f in args.file:
            p = os.path.join(d, f)

            for chunk in slave_file.SlaveFile(s, p):
                print chunk
{'fraction_non_alphanumeric': 0.12348993288590604, 'fraction_numerical': 0.0, 'mean_word_length': 2.9031413612565444, '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': '5239292', 'n_tokens_mistral': 499, 'n_tokens_neox': 490, 'n_words': 162}