code: def sendEvent(self, eventType, eventData):
      msgDict = {"event": eventType}
      if eventData:
          msgDict["data"] = eventData
      msg = json.dumps(msgDict)
      self.send(msg, False)
  
imports: import json
  from six.moves.urllib.parse import urlencode
  import pyalgotrade
  from pyalgotrade.websocket import client
  import pyalgotrade.logger
label_desc: Use image node_id 2 for calling the WebSocketClient obj's underlying member method code with example usage: obj.sendEvent(eventType, eventData) without return types