<commit_before>#!/usr/bin/python3

import wtfexpect

try:
	with wtfexpect.WtfExpect() as we:
		servers = 'alpha bravo conan'.split()
		clients = 'xenon yeast zebra'.split()
		serverids = {name: i for i, name in enumerate(servers)}

		cfg = []
		baseport = 6000
		for i in range(len(servers)):
			cfg.append('-r')
			cfg.append("%d:%s:%d" % (i, "127.0.0.1", baseport + i))

		for i, s in enumerate(servers):
			we.spawn(s, [
				'bin/server',
				'-i', str(i),
				*cfg,
			])

		for c in clients:
			we.spawn(c, ['bin/client', '-k', c, *cfg])

		while we.alive():
			timeout = 0.5
			name, line = we.readline(timeout)
			if name is None: continue

			if line is None:
				code = we.getcode(name)
				if name in servers:
					print("%d(%s) finished with code %d" % (serverids[name], name, code))
				else:
					print("%s finished with code %d" % (name, code))
			else:
				if name in servers:
					print("[%d(%s)] %s" % (serverids[name], name, line))
				else:
					print("[%s] %s" % (name, line))
except KeyboardInterrupt:
	print("killed")<commit_msg>Insert a delay between example client launches.<commit_after>#!/usr/bin/python3

import time
import wtfexpect

try:
	with wtfexpect.WtfExpect() as we:
		servers = 'alpha bravo conan'.split()
		clients = 'xenon yeast zebra'.split()
		serverids = {name: i for i, name in enumerate(servers)}

		cfg = []
		baseport = 6000
		for i in range(len(servers)):
			cfg.append('-r')
			cfg.append("%d:%s:%d" % (i, "127.0.0.1", baseport + i))

		for i, s in enumerate(servers):
			we.spawn(s, [
				'bin/server',
				'-i', str(i),
				*cfg,
			])

		for c in clients:
			time.sleep(0.333)
			we.spawn(c, ['bin/client', '-k', c, *cfg])

		while we.alive():
			timeout = 0.5
			name, line = we.readline(timeout)
			if name is None: continue

			if line is None:
				code = we.getcode(name)
				if name in servers:
					print("%d(%s) finished with code %d" % (serverids[name], name, code))
				else:
					print("%s finished with code %d" % (name, code))
			else:
				if name in servers:
					print("[%d(%s)] %s" % (serverids[name], name, line))
				else:
					print("[%s] %s" % (name, line))
except KeyboardInterrupt:
	print("killed")
{'fraction_non_alphanumeric': 0.17842323651452283, 'fraction_numerical': 0.013831258644536652, 'mean_word_length': 3.0636704119850187, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '317334', 'n_tokens_mistral': 991, 'n_tokens_neox': 827, 'n_words': 232}