<commit_before>from sockjs.tornado import SockJSConnection
from whirlwind.db.mongo import Mongo
import json

class SockjsBaseRequest(SockJSConnection):

	def __init__(self, sjsession):
		SockJSConnection.__init__(self, sjsession)
		self.db = Mongo.db.ui

	def send_message(self,message):
		if isinstance(message, basestring):
			self.send(message)
		else:
			self.send(json.dumps(message))<commit_msg>updated sockjs support<commit_after>from sockjs.tornado import SockJSConnection
from whirlwind.db.mongo import Mongo
import json


class SockjsBaseRequest(SockJSConnection):

	def __init__(self, session):
		SockJSConnection.__init__(self, session)
		self.db = Mongo.db.ui

	def send_message(self,message):
		if isinstance(message, basestring):
			self.send(message)
		else:
			self.send(json.dumps(message))
{'fraction_non_alphanumeric': 0.09653465346534654, 'fraction_numerical': 0.0, 'mean_word_length': 5.974137931034483, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6027361', 'n_tokens_mistral': 293, 'n_tokens_neox': 261, 'n_words': 55}