<commit_before>"""
Main module that configures tcpr, copies all the files to the virtual
machines, runs all the different processes, and cleans up the temporary
files and processes afterwards.
"""

import argparse
import pkg_resources
import random
import shutil
import subprocess
import sys
import tempfile
import time
import zipfile

from path import path

from .vmapi import VM
from .utils import get_random_string

__version__ = '0.1.1'

_TCPR_INI_TEMPLATE = """
[server]

# server
listen=0.0.0.0:%(server_port)d

# admin console
listen_cmd=0.0.0.0:%(console_port)d

listen_http=

# The reflector will listen on the address and port range below
reflector=0.0.0.0:%(forward_port_minus_one)d-%(forward_port_minus_one)d-%(forward_port_plus_one)d

user_db=%(temp_dir)s\user_db

# Send keep alive packets to every connected client at regular intervals.
# Time is in seconds. 0 disables the sending of these packets.
alive_interval=120

# When no packets have been received for "alive_timeout" seconds, close
# the connection. Clients can try to reconnect afterwards.<commit_msg>Bump minor version.<commit_after>"""
Main module that configures tcpr, copies all the files to the virtual
machines, runs all the different processes, and cleans up the temporary
files and processes afterwards.
"""

import argparse
import pkg_resources
import random
import shutil
import subprocess
import sys
import tempfile
import time
import zipfile

from path import path

from .vmapi import VM
from .utils import get_random_string

__version__ = '0.1.2'

_TCPR_INI_TEMPLATE = """
[server]

# server
listen=0.0.0.0:%(server_port)d

# admin console
listen_cmd=0.0.0.0:%(console_port)d

listen_http=

# The reflector will listen on the address and port range below
reflector=0.0.0.0:%(forward_port_minus_one)d-%(forward_port_minus_one)d-%(forward_port_plus_one)d

user_db=%(temp_dir)s\user_db

# Send keep alive packets to every connected client at regular intervals.
# Time is in seconds. 0 disables the sending of these packets.
alive_interval=120

# When no packets have been received for "alive_timeout" seconds, close
# the connection. Clients can try to reconnect afterwards.
{'fraction_non_alphanumeric': 0.07453703703703704, 'fraction_numerical': 0.017592592592592594, 'mean_word_length': 5.431547619047619, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, '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': '6399585', 'n_tokens_mistral': 687, 'n_tokens_neox': 676, 'n_words': 245}