<commit_before>from __future__ import division, absolute_import
import threading

from . import chainlink


class ChainDriver(chainlink.ChainLink):
    """
    Actively drives chains by pulling them

    This driver pulls all mounted chains via a single thread. This drives chains
    synchronously, but blocks all chains if any individual chain blocks.
    """
    def __init__(self):
        super(ChainDriver, self).__init__()
        self.mounts = []
        self._run_lock = threading.Lock()
        self._run_thread = None

    def mount(self, *chains):
        """Add chains to this driver"""
        self.mounts.extend(chains)

    @property
    def running(self):
        """Whether the driver is running, either via :py:meth:`run` or :py:meth:`start`"""
        return self._run_lock.locked()
<commit_msg>drivers no longer act as chain elements<commit_after>from __future__ import division, absolute_import
import threading


class ChainDriver(object):
    """
    Actively drives chains by pulling them

    This driver pulls all mounted chains via a single thread. This drives chains
    synchronously, but blocks all chains if any individual chain blocks.
    """
    def __init__(self):
        self.mounts = []
        self._run_lock = threading.Lock()
        self._run_thread = None

    def mount(self, *chains):
        """Add chains to this driver"""
        self.mounts.extend(chains)

    @property
    def running(self):
        """Whether the driver is running, either via :py:meth:`run` or :py:meth:`start`"""
        return self._run_lock.locked()

{'fraction_non_alphanumeric': 0.0940279542566709, 'fraction_numerical': 0.0, 'mean_word_length': 3.0488431876606685, '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': '5856123', 'n_tokens_mistral': 439, 'n_tokens_neox': 421, 'n_words': 149}