code: def handle_resize(self, event):
      x, y = event.get("width", 800), event.get("height", 800)
      x, y = int(x) * self._dpi_ratio, int(y) * self._dpi_ratio
      fig = self.figure
      # An attempt at approximating the figure size in pixels.
      fig.set_size_inches(x / fig.dpi, y / fig.dpi, forward=False)
  
      _, _, w, h = self.figure.bbox.bounds
      # Acknowledge the resize, and force the viewer to update the
      # canvas size to the figure's new size (which is hopefully
      # identical or within a pixel or so).
      self._png_is_old = True
      self.manager.resize(w, h)
      self.resize_event()
  
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 16 for calling the FigureCanvasWebAggCore obj's underlying member method code with example usage: obj.handle_resize(event) without return types