<commit_before>from contextlib import contextmanager
from tfmesos.scheduler import Job, TFMesosScheduler

__VERSION__ = '0.0.1'


@contextmanager
def cluster(jobs, master=None, name=None, quiet=False,
            volumes={}, local_task=None, containerizer_type=None):
    if isinstance(jobs, dict):
        jobs = [Job(**jobs)]

    if isinstance(jobs, Job):
        jobs = [jobs]

    jobs = [job if isinstance(job, Job) else Job(**job)
            for job in jobs]
    s = TFMesosScheduler(jobs, master=master, name=name, quiet=quiet,
                         volumes=volumes, local_task=local_task,
                         containerizer_type=containerizer_type)
    yield s.start()
    s.stop()
<commit_msg>Update __init__.py<commit_after>from contextlib import contextmanager
from tfmesos.scheduler import Job, TFMesosScheduler

__VERSION__ = '0.0.2'


@contextmanager
def cluster(jobs, master=None, name=None, quiet=False,
            volumes={}, local_task=None, containerizer_type=None):
    if isinstance(jobs, dict):
        jobs = [Job(**jobs)]

    if isinstance(jobs, Job):
        jobs = [jobs]

    jobs = [job if isinstance(job, Job) else Job(**job)
            for job in jobs]
    s = TFMesosScheduler(jobs, master=master, name=name, quiet=quiet,
                         volumes=volumes, local_task=local_task,
                         containerizer_type=containerizer_type)
    yield s.start()
    s.stop()

{'fraction_non_alphanumeric': 0.10861948142957253, 'fraction_numerical': 0.004204625087596356, 'mean_word_length': 2.9123287671232876, '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': '4771315', 'n_tokens_mistral': 453, 'n_tokens_neox': 426, 'n_words': 105}