code: def closed(self, code, reason=None):
      wasConnected = self.__connected
      self.__connected = False
      if self.__keepAliveMgr:
          self.__keepAliveMgr.stop()
          self.__keepAliveMgr = None
      tornado.ioloop.IOLoop.instance().stop()
  
      if wasConnected:
          self.onClosed(code, reason)
  
imports: import json
  import time
  import threading
  import six
  from ws4py.client import tornadoclient
  import tornado
  import pyalgotrade.logger
label_desc: Use image node_id 7 for calling the WebSocketClientBase obj's underlying member method code with example usage: obj.closed(code, reason) without return types