<commit_before>import queue
import threading

class Action:
    func = None
    args = []
    kwargs = {}

    def __init__(self, f=None, args=[], kwargs={}):
        self.func = f
        self.args = args
        self.kwargs = kwargs
        return

class ActionQueue:
    def __init__(self):
        self.Q = queue.Queue()
        t = threading.Thread(target=self.action_parser)
        t.start()

    def action_parser(self):
        while True:
            action = self.Q.get()
            action.func(*action.args, **action.kwargs)

    def add(self, f, args=[], kwargs={}):
        action = Action()
        action.func = f

        action.args = args<commit_msg>Action thread is now daemonized<commit_after>import queue
import threading

class Action:
    func = None
    args = []
    kwargs = {}

    def __init__(self, f=None, args=[], kwargs={}):
        self.func = f
        self.args = args
        self.kwargs = kwargs
        return

class ActionQueue:
    def __init__(self):
        self.Q = queue.Queue()
        t = threading.Thread(target=self.action_parser)
        t.daemon = True
        t.start()

    def action_parser(self):
        while True:
            action = self.Q.get()
            action.func(*action.args, **action.kwargs)

    def add(self, f, args=[], kwargs={}):
        action = Action()
        action.func = f

        action.args = args
{'fraction_non_alphanumeric': 0.12445730824891461, 'fraction_numerical': 0.0, 'mean_word_length': 1.9741935483870967, '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': '5744779', 'n_tokens_mistral': 421, 'n_tokens_neox': 418, 'n_words': 105}