#NEWLINE# @ contextmanager #NEWLINE# def extra_context( self , connection , channel ) : #NEWLINE# #INDENT# self . send_online ( ) #NEWLINE# self . wakeup ( ) #NEWLINE# sleep ( 1.0 ) #NEWLINE# if self . on_awake : #NEWLINE# #INDENT# self . on_awake ( ) #NEWLINE# #UNINDENT# timer ( self . interval , self . send_heartbeat ) #NEWLINE# self . agent . on_presence_ready ( ) #NEWLINE# ( yield ) #NEWLINE# self . send_offline ( )