code: def _create_image_figure(
      image: np.ndarray,
      fig_size: int = 900,
      title: str = "",
      tools: str = "",
  ) -> plotting.figure:
      """Creates a Bokeh figure showing an image."""
      # Determine relative width and height from padding. We assume that padding is
      # added on the bottom or right and has value 0.5:
      width = np.mean(np.any(image[..., 0] != 0.5, axis=0))
      height = np.mean(np.any(image[..., 0] != 0.5, axis=1))
      plot_width = int(width * fig_size)
      plot_height = int(height * fig_size)
      if bokeh.__version__ >= "3.0.3":
          plot_size_kws = {"width": plot_width, "height": plot_height}
      else:
          plot_size_kws = {
              "plot_width": plot_width,
              "plot_height": plot_height,
          }
      plot = plotting.figure(
          title=title,
          x_range=[0.0, width],
          y_range=[height, 0.0],
          tools=tools,
          **plot_size_kws,
      )
      plot.axis.visible = False
      plot.toolbar.logo = None
      image = _bokeh_format_image(image)
      if bokeh.__version__ >= "3.0.3":
          plot.image_rgba(image=[image], x=0.0, y=0.0, dw=1.0, dh=1.0)
      else:
          plot.image_rgba(image=[image], x=0.0, y=1.0, dw=1.0, dh=1.0)
      return plot
  
file_path: scenic/scenic/projects/owl_vit/notebooks/plotting.py
imports: import bokeh
  from bokeh import events
  from bokeh import layouts
  from bokeh import models
  from bokeh import plotting
  from bokeh.models import widgets
  import numpy
  from scenic.model_lib.base_models import box_utils
  from scenic.projects.owl_vit.notebooks import interactive
label_desc: Use image node_id 3 for calling a global function with example usage: _create_image_figure(image, fig_size, title, tools) and returns: plot