<commit_before>import core
from girder_worker.utils import JobStatus
from .app import app


def _cleanup(*args, **kwargs):
    core.events.trigger('cleanup')


@app.task(name='girder_worker.run', bind=True, after_return=_cleanup)
def run(tasks, *pargs, **kwargs):
    jobInfo = kwargs.pop('jobInfo', {})
    retval = 0

    kwargs['_job_manager'] = task.job_manager \
        if hasattr(task, 'job_manager') else None

    kwargs['status'] = JobStatus.RUNNING

    return core.run(*pargs, **kwargs)


@app.task(name='girder_worker.convert')
def convert(*pargs, **kwargs):
    return core.convert(*pargs, **kwargs)


@app.task(name='girder_worker.validators')
def validators(*pargs, **kwargs):
    _type, _format = pargs
    nodes = []

    for (node, data) in core.format.conv_graph.nodes(data=True):
        if ((_type is None) or (_type == node.type)) and \
           ((_format is None) or (_format == node.format)):
            nodes.append({'type': node.type,
                          'format': node.format,
                          'validator': data})

    return nodes
<commit_msg>Fix typo from bad conflict resolution during merge<commit_after>import core
from girder_worker.utils import JobStatus
from .app import app


def _cleanup(*args, **kwargs):
    core.events.trigger('cleanup')


@app.task(name='girder_worker.run', bind=True, after_return=_cleanup)
def run(task, *pargs, **kwargs):
    kwargs['_job_manager'] = task.job_manager \
        if hasattr(task, 'job_manager') else None

    kwargs['status'] = JobStatus.RUNNING

    return core.run(*pargs, **kwargs)


@app.task(name='girder_worker.convert')
def convert(*pargs, **kwargs):
    return core.convert(*pargs, **kwargs)


@app.task(name='girder_worker.validators')
def validators(*pargs, **kwargs):
    _type, _format = pargs
    nodes = []

    for (node, data) in core.format.conv_graph.nodes(data=True):
        if ((_type is None) or (_type == node.type)) and \
           ((_format is None) or (_format == node.format)):
            nodes.append({'type': node.type,
                          'format': node.format,
                          'validator': data})

    return nodes

{'fraction_non_alphanumeric': 0.14629629629629629, 'fraction_numerical': 0.000462962962962963, 'mean_word_length': 3.163776493256262, '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': '5683150', 'n_tokens_mistral': 689, 'n_tokens_neox': 678, 'n_words': 161}