<commit_before>from xmppd import filter
from xmpp  import *
from spade import *

class Component(filter.Filter):

	def test(self,stanza):
		#Counter measure for component originated messages
		the_from = stanza['from']
		simple_from = str(the_from)
		if not('@' in simple_from):  # Component-originated
			if stanza.getNamespace()==NS_COMPONENT_ACCEPT and stanza.getName()=='message':
				#self._router.DEBUG("Message for a component",'info')
				return True
		#self._router.DEBUG("Message NOT for a component",'error')
		return False


	def filter(self,session,stanza):

			to = stanza['to']
			s=self._router.getsession(to)<commit_msg>packaging<commit_after>from xmppd import filter
from xmpp  import *
from spade import *

class Component(filter.Filter):

	def test(self,stanza):
		#Counter measure for component originated messages
		the_from = stanza['from']
		simple_from = str(the_from)
		if not('@' in simple_from):  # Component-originated
			if stanza.getNamespace()==NS_COMPONENT_ACCEPT and stanza.getName()=='message':
				#self._router.DEBUG("Message for a component",'info')
				return True
		#self._router.DEBUG("Message NOT for a component",'error')
		return False


	def filter(self,session,stanza):

			try:
				to = stanza['to']
				s=self._router.getsession(to)
			except:
				print "<NAME>"
{'fraction_non_alphanumeric': 0.12366412213740458, 'fraction_numerical': 0.0, 'mean_word_length': 4.826666666666667, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '91534', 'n_tokens_mistral': 477, 'n_tokens_neox': 418, 'n_words': 105}