<commit_before>import socket, io, struct, blocks, time
from twisted.python import log
from threading import Thread

shipList = {
	12100 : "192.168.3.11",
	12200 : "172.16.58.3",
	12300 : "192.168.3.11",
	12400 : "172.16.58.3",
	12500 : "192.168.3.11",
	12600 : "192.168.127.12",
	12700 : "192.168.3.11",
	12800 : "172.16.31.10",
	12900 : "192.168.127.12",
	12000 : "172.16.31.10",
}

class BlockScrapingManager(object):
	def __init__(self):
		global shipList
		self.lines = {}
		for port, addr in shipList.iteritems():
			self.lines[port] = BlockLine(addr, port)
			self.lines[port].start()
			self.shuttingDown = False
		

	def getInLine(self, shipIp, shipPort, dstIp):
		line = self.lines[shipPort]
		identifier = line.getNextIdentifier()
		line.requests.append({'identifier': identifier, 'shipIp': shipIp, 'shipPort': shipPort, 'dstIp': dstIp})
		print("[BlockLine] Request #%i got in line." % identifier)
		while identifier not in line.results:
			time.sleep(1)
			if self.shuttingDown:
				return None
		prize = line.results[identifier]
		print("[BlockLine] Request #%i got their prize." % identifier)
		del line.results[identifier]
		return prize

	def killBline(self):
		for line in self.lines:
			self.lines[line].active = False
			self.shuttingDown = True
	


class BlockLine(Thread):
	def __init__(self, addr, port):<commit_msg>Remove any remaining requests in the event of fail<commit_after>import socket, io, struct, blocks, time
from twisted.python import log
from threading import Thread

shipList = {
	12100 : "192.168.3.11",
	12200 : "172.16.58.3",
	12300 : "192.168.3.11",
	12400 : "172.16.58.3",
	12500 : "192.168.3.11",
	12600 : "192.168.127.12",
	12700 : "192.168.3.11",
	12800 : "172.16.31.10",
	12900 : "192.168.127.12",
	12000 : "172.16.31.10",
}

class BlockScrapingManager(object):
	def __init__(self):
		global shipList
		self.lines = {}
		for port, addr in shipList.iteritems():
			self.lines[port] = BlockLine(addr, port)
			self.lines[port].start()
			self.shuttingDown = False
		

	def getInLine(self, shipIp, shipPort, dstIp):
		line = self.lines[shipPort]
		identifier = line.getNextIdentifier()
		line.requests.append({'identifier': identifier, 'shipIp': shipIp, 'shipPort': shipPort, 'dstIp': dstIp})
		print("[BlockLine] Request #%i got in line." % identifier)
		while identifier not in line.results:
			time.sleep(1)
			if self.shuttingDown:
				line.requests.remove({'identifier': identifier, 'shipIp': shipIp, 'shipPort': shipPort, 'dstIp': dstIp})
				return None
		prize = line.results[identifier]
		print("[BlockLine] Request #%i got their prize." % identifier)
		del line.results[identifier]
		return prize

	def killBline(self):
		for line in self.lines:
			self.lines[line].active = False
			self.shuttingDown = True
	


class BlockLine(Thread):
	def __init__(self, addr, port):
{'fraction_non_alphanumeric': 0.14918497519489723, 'fraction_numerical': 0.10134656272147413, 'mean_word_length': 4.068222621184919, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 20, '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': '6917314', 'n_tokens_mistral': 1254, 'n_tokens_neox': 1010, 'n_words': 247}