def __init__(self, addr, sendinit=None, on_data=None, on_open=None, on_close=None, raw=True):
self.addr = addr<EOL>self.sendinit = sendinit<EOL>on_data = on_data or print<EOL>class Namespace(BaseNamespace):<EOL><INDENT>def on_connect(self, *data):<EOL><INDENT>if on_open:<EOL><INDENT>on_open(_tryJson(data, raw))<EOL><DEDENT><DEDENT>def on_disconnect(self, *data):<EOL><INDENT>if on_close:<EOL><INDENT>on_close(_tryJson(data, raw))<EOL><DEDENT><DEDENT>def on_message(self, data):<EOL><INDENT>on_data(_tryJson(data, raw))<EOL><DEDENT><DEDENT>self._Namespace = Namespace<EOL>
addr: path to sio
sendinit: tuple to emit
on_data, on_open, on_close: functions to call