class_docstr: This websocket client class is designed to be running in a separate thread and for that reason
  events are pushed into a queue.
class_docstr_tok: ["This","websocket","client","class","is","designed","to","be","running","in","a","separate","thread","and","for","that","reason","events","are","pushed","into","a","queue","."]
code: def onMessage(self, msg):
      # If we can't handle the message, forward it to Pusher WebSocketClient.
      event = msg.get("event")
      if event == "trade":
          self.onTrade(Trade(get_current_datetime(), msg))
      elif event == "data" and msg.get("channel") == "order_book":
          self.onOrderBookUpdate(
              OrderBookUpdate(get_current_datetime(), msg)
          )
      else:
          super(WebSocketClient, self).onMessage(msg)
  
imports: import datetime
  from six.moves import queue
  from pyalgotrade.websocket import pusher
  from pyalgotrade.websocket import client
  from pyalgotrade.bitstamp import common
label_desc: Use image node_id 2 for calling the WebSocketClient obj's underlying member method code with example usage: obj.onMessage(msg) without return types