code: def add_web_socket(self, web_socket):
      assert hasattr(web_socket, "send_binary")
      assert hasattr(web_socket, "send_json")
  
      self.web_sockets.add(web_socket)
  
      _, _, w, h = self.canvas.figure.bbox.bounds
      self.resize(w, h)
      self._send_event("refresh")
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import six
  import datetime
  import io
  import json
  import os
  import warnings
  import numpy
  import tornado
  from matplotlib.backends import backend_agg
  from matplotlib.backend_bases import _Backend
  from matplotlib import backend_bases
  from matplotlib import _png
label_desc: Use image node_id 6 for calling the FigureManagerWebAgg obj's underlying member method code with example usage: obj.add_web_socket(web_socket) without return types