code: def new_figure_manager_given_figure(num, figure):
      canvas = FigureCanvasNbAgg(figure)
      manager = FigureManagerNbAgg(canvas, num)
      if is_interactive():
          manager.show()
          figure.canvas.draw_idle()
      canvas.mpl_connect("close_event", lambda event: Gcf.destroy(num))
      return manager
  
imports: import six
  from base64 import b64encode
  import io
  import json
  import os
  import uuid
  from IPython.display import display, Javascript, HTML
  from matplotlib import rcParams, is_interactive
  from matplotlib._pylab_helpers import Gcf
  from matplotlib.backend_bases import _Backend, FigureCanvasBase, NavigationToolbar2
  from matplotlib.backends.backend_webagg_core import FigureCanvasWebAggCore, FigureManagerWebAgg, NavigationToolbar2WebAgg, TimerTornado
label_desc: Use image node_id 1 for calling the _BackendNbAgg obj's underlying member method code with example usage: obj.new_figure_manager_given_figure(num, figure) and returns: manager