<commit_before>from twisted.internet import reactor
from twisted.internet.defer import Deferred
from twisted.internet.task import LoopingCall
from txircd.ircbase import IRCBase
from txircd.utils import now

class IRCServer(IRCBase):
	def __init__(self, ircd, ip, received):
		self.ircd = ircd
		self.serverID = None
		self.name = None
		self.description = None
		self.ip = ip
		self.nextClosest = self.ircd.serverID
		self.cache = {}
		self.bursted = None
		self.disconnectedDeferred = Deferred()
		self.receivedConnection = received
		self._pinger = LoopingCall(self._ping)
		self._registrationTimeoutTimer = reactor.callLater(self.ircd.config.get("server_registration_timeout", 10), self._timeoutRegistration)
		self._burstQueueCommands = []
		self._burstQueueHandlers = {}
	
	def handleCommand(self, command, params, prefix, tags):
		if command not in self.ircd.serverCommands:
			self.disconnect("Unknown command {}".format(command)) # If we receive a command we don't recognize, abort immediately to avoid a desync
			return
		handlers = self.ircd.serverCommands[command]
		data = None
		for handler in handlers:
			if self.bursted is False and handler[0].burstQueuePriority is not None:
				if command not in self._burstQueueCommands:
					handlerPriority = handler[0].burstQueuePriority
					for cmdIndex, queueCommand in enumerate(self._burstQueueCommands):
						queueCommandPriority = self.ircd.commands[queueCommand][0].burstQueuePriority
						if queueCommandPriority < handlerPriority:<commit_msg>Don't process leftover commands for disconnected servers<commit_after>from twisted.internet import reactor
from twisted.internet.defer import Deferred
from twisted.internet.task import LoopingCall
from txircd.ircbase import IRCBase
from txircd.utils import now

class IRCServer(IRCBase):
	def __init__(self, ircd, ip, received):
		self.ircd = ircd
		self.serverID = None
		self.name = None
		self.description = None
		self.ip = ip
		self.nextClosest = self.ircd.serverID
		self.cache = {}
		self.bursted = None
		self.disconnectedDeferred = Deferred()
		self.receivedConnection = received
		self._pinger = LoopingCall(self._ping)
		self._registrationTimeoutTimer = reactor.callLater(self.ircd.config.get("server_registration_timeout", 10), self._timeoutRegistration)
		self._burstQueueCommands = []
		self._burstQueueHandlers = {}
	
	def handleCommand(self, command, params, prefix, tags):
		if self.serverID not in self.ircd.servers:
			return # Don't process leftover commands for disconnected servers
		if command not in self.ircd.serverCommands:
			self.disconnect("Unknown command {}".format(command)) # If we receive a command we don't recognize, abort immediately to avoid a desync
			return
		handlers = self.ircd.serverCommands[command]
		data = None
		for handler in handlers:
			if self.bursted is False and handler[0].burstQueuePriority is not None:
				if command not in self._burstQueueCommands:
					handlerPriority = handler[0].burstQueuePriority
					for cmdIndex, queueCommand in enumerate(self._burstQueueCommands):
						queueCommandPriority = self.ircd.commands[queueCommand][0].burstQueuePriority
						if queueCommandPriority < handlerPriority:
{'fraction_non_alphanumeric': 0.08341202392193893, 'fraction_numerical': 0.0031476235442241107, 'mean_word_length': 4.8311926605504585, 'pattern_counts': {'":': 0, '<': 5, '<?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': '573556', 'n_tokens_mistral': 1039, 'n_tokens_neox': 908, 'n_words': 252}