code: def handle_set_dpi_ratio(self, event):
      dpi_ratio = event.get("dpi_ratio", 1)
      if dpi_ratio != self._dpi_ratio:
          # We don't want to scale up the figure dpi more than once.
          if not hasattr(self.figure, "_original_dpi"):
              self.figure._original_dpi = self.figure.dpi
          self.figure.dpi = dpi_ratio * self.figure._original_dpi
          self._dpi_ratio = dpi_ratio
          self._force_full = True
          self.draw_idle()
  
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 18 for calling the FigureCanvasWebAggCore obj's underlying member method code with example usage: obj.handle_set_dpi_ratio(event) without return types