code: def _display_plot(spec: Any):
      """
      Draw plot or `bunch` of plots in the current frontend context
      :param spec: PlotSpec or GGBunch object
      """
      if not (
          isinstance(spec, PlotSpec)
          or isinstance(spec, SupPlotsSpec)
          or isinstance(spec, GGBunch)
      ):
          raise ValueError(
              "PlotSpec, SupPlotsSpec or GGBunch expected but was: {}".format(
                  type(spec)
              )
          )
  
      if _default_mimetype == TEXT_HTML:
          plot_html = _as_html(spec.as_dict())
          try:
              from IPython.display import display_html
  
              display_html(plot_html, raw=True)
              return
          except ImportError:
              pass
  
          # ToDo: show HTML in a browser window.
          print(spec.as_dict())
          return
  
      if _default_mimetype == LETS_PLOT_JSON:
          _frontend_contexts[LETS_PLOT_JSON].show(spec.as_dict())
          return
  
      # fallback to plain text.
      print(spec.as_dict())
  
file_path: lets-plot/python-package/lets_plot/frontend_context/_configuration.py
imports: from typing import Dict, Any
  from ._frontend_ctx import FrontendContext
  from ._html_contexts import _create_html_frontend_context, _use_isolated_frame
  from ._json_contexts import _create_json_frontend_context, _is_Intellij_Python_Lets_Plot_Plugin
  from ._mime_types import TEXT_HTML, LETS_PLOT_JSON
  from ._static_svg_ctx import StaticSvgImageContext
  from .._version import __version__
  from ..plot.core import PlotSpec
  from ..plot.plot import GGBunch
  from ..plot.subplots import SupPlotsSpec
label_desc: Use image node_id 2 for calling a global function with example usage: _display_plot(spec) without return types