<commit_before># -*- coding: utf-8 -*-
from __future__ import absolute_import

import os

from .base import BasePool, apply_target


class TaskPool(BasePool):
    """Solo task pool (blocking, inline)."""

    def on_start(self):
        self.pid = os.getpid()

    def on_apply(self, target, args, kwargs, callback=None,
            accept_callback=None, **_):
        return apply_target(target, args, kwargs,
                            callback, accept_callback, self.pid)

    def _get_info(self):
        return {"max-concurrency": 1,
                "processes": [self.pid],
                "max-tasks-per-child": None,
                "put-guarded-by-semaphore": True,
                "timeouts": ()}<commit_msg>solo pool now uses apply_target directly<commit_after># -*- coding: utf-8 -*-
from __future__ import absolute_import

import os

from .base import BasePool, apply_target


class TaskPool(BasePool):
    """Solo task pool (blocking, inline)."""

    def __init__(self, *args, **kwargs):
        super(TaskPool, self).__init__(*args, **kwargs)
        self.on_apply = apply_target

    def _get_info(self):
        return {"max-concurrency": 1,
                "processes": [self.pid],
                "max-tasks-per-child": None,
                "put-guarded-by-semaphore": True,
                "timeouts": ()}
{'fraction_non_alphanumeric': 0.13177710843373494, 'fraction_numerical': 0.0030120481927710845, 'mean_word_length': 2.3391959798994977, 'pattern_counts': {'":': 10, '<': 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': '4594740', 'n_tokens_mistral': 412, 'n_tokens_neox': 394, 'n_words': 98}