<commit_before>"""Use python's multiprocessing module to create multiple processes and speed
up the completion of functions/classes."""

from multiprocessing import Pool, cpu_count, get_logger
from time import time
import logging
import logzero


class Multiprocess(object):
    """Use multiple processes with functions."""
    def __init__(self, num_procs, function, listinput):
        self.num_procs = num_procs  # Number of processes to run

        # Force user to use optimal number of processes
        if int(self.num_procs) > (int(cpu_count) - 1):
            raise ValueError('Too many processes assingned.')

        self.function = function  # User function that takes 1 item or list
        self.listinput = listinput  # List to map to a function
        self.iterable = self.listinput
        self.log = self._logger()

    def _logger(self):
        """Add the multiprocessing module's logger."""<commit_msg>Edited multiprocess docstring<commit_after>"""Use python's multiprocessing module to create multiple processes and speed
up the completion of functions/classes."""

from multiprocessing import Pool, cpu_count, get_logger
from time import time
import logging
import logzero


class Multiprocess(object):
    """Use multiple processes with a function."""
    def __init__(self, num_procs, function, listinput):
        self.num_procs = num_procs  # Number of processes to run

        # Force user to use optimal number of processes
        if int(self.num_procs) > (int(cpu_count) - 1):
            raise ValueError('Too many processes assigned.')

        self.function = function  # User function that takes 1 item or list
        self.listinput = listinput  # List to map to a function
        self.iterable = self.listinput
        self.log = self._logger()

    def _logger(self):
        """Add the multiprocessing module's logger."""
{'fraction_non_alphanumeric': 0.079484425349087, 'fraction_numerical': 0.0021482277121374865, 'mean_word_length': 3.292626728110599, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '919890', 'n_tokens_mistral': 504, 'n_tokens_neox': 487, 'n_words': 190}