<commit_before>from pylm.registry.clients.registry import request
from pylm.registry.clients import LogClient

from subprocess import Popen, PIPE
from concurrent.futures import ThreadPoolExecutor, as_completed

import argparse
import configparser
import traceback
import zmq
import sys

context = zmq.Context()


def parse_args():
    parser = argparse.ArgumentParser(description="Execute a PALM runner")
    parser.add_argument('--registry', help="URI of the registry", type=str, required=True)
    parser.add_argument('--cluster', help="sets the cluster key", type=str, required=True)
    parser.add_argument('--config', help="File with the node configuration", type=str, required=True)

    return parser.parse_args()


def message_hub(client):
    pull_socket = context.socket(zmq.PULL)
    pull_socket.bind("inproc://hub")

    while True:
        message = pull_socket.recv()
        message = message.decode('utf-8')
        message = message.strip('\n')
        if message:
            client.send(message)


def process_wrapper(commands):
    push_socket = context.socket(zmq.PUSH)
    push_socket.connect("inproc://hub")

    with Popen(commands, stdout=PIPE, bufsize=1, universal_newlines=True) as p:<commit_msg>Some tweaks that do not seem to have any effect on performance.<commit_after>from pylm.registry.clients.registry import request
from pylm.registry.clients import LogClient

from subprocess import Popen, PIPE
from concurrent.futures import ThreadPoolExecutor, as_completed

import argparse
import configparser
import traceback
import zmq
import sys

context = zmq.Context()


def parse_args():
    parser = argparse.ArgumentParser(description="Execute a PALM runner")
    parser.add_argument('--registry', help="URI of the registry", type=str, required=True)
    parser.add_argument('--cluster', help="sets the cluster key", type=str, required=True)
    parser.add_argument('--config', help="File with the node configuration", type=str, required=True)

    return parser.parse_args()


def message_hub(client):
    pull_socket = context.socket(zmq.PULL)
    pull_socket.bind("inproc://hub")

    while True:
        message = pull_socket.recv()
        message = message.decode('utf-8')
        message = message.strip('\n')
        if message:
            client.send(message)


def process_wrapper(commands):
    push_socket = context.socket(zmq.PUSH)
    push_socket.connect("inproc://hub")

    with Popen(commands, stdout=PIPE, universal_newlines=True) as p:
{'fraction_non_alphanumeric': 0.10985915492957747, 'fraction_numerical': 0.0012072434607645875, 'mean_word_length': 4.2893617021276595, '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': '202859', 'n_tokens_mistral': 740, 'n_tokens_neox': 719, 'n_words': 187}