#NEWLINE# def on_join( session ) : #NEWLINE# #INDENT# '\n    This is user code triggered when a session was created on top of\n    a connection, and the sessin has joined a realm.\n    ' #NEWLINE# print ( 'session connected: {}' . format ( session ) ) #NEWLINE# def on_leave( details ) : #NEWLINE# #INDENT# print ( 'on_leave' , details ) #NEWLINE# #UNINDENT# session . on_leave ( session ) #NEWLINE# session . leave ( )