code: def _to_html(chart) -> str:
      if _is_matplotlib_pyplot(chart):
          chart = chart.gcf()
  
      if is_matplotlib_figure(chart):
          try:
              chart = _matplotlib_to_plotly(chart)
              return _export_plotly_figure(chart)
          except ImportError:
              logger.warning(
                  "Plotly not installed. Logging plot as an image."
              )
              return _image_content_to_html(
                  _get_figure_image_data(chart)
              )
          except UserWarning:
              logger.warning(
                  "Couldn't convert Matplotlib plot to interactive Plotly plot. Logging plot as an image instead."
              )
              return _image_content_to_html(
                  _get_figure_image_data(chart)
              )
  
      elif is_pandas_dataframe(chart):
          return _export_pandas_dataframe_to_html(chart)
  
      elif is_plotly_figure(chart):
          return _export_plotly_figure(chart)
  
      elif is_altair_chart(chart):
          return _export_altair_chart(chart)
  
      elif is_bokeh_figure(chart):
          return _export_bokeh_figure(chart)
  
      elif is_seaborn_figure(chart):
          return _export_seaborn_figure(chart)
  
      else:
          raise ValueError(
              "Currently supported are matplotlib, plotly, altair, bokeh and seaborn figures"
          )
  
imports: import base64
  import io
  import logging
  import pickle
  import warnings
  from io import BytesIO, StringIO
  from typing import Optional
  from packaging import version
  from pandas import DataFrame
  from neptune.exceptions import PlotlyIncompatibilityException
  from neptune.internal.utils.logger import logger
label_desc: Use image node_id 5 for calling a global function with example usage: _to_html(chart) and returns: _export_plotly_figure, _export_pandas_dataframe_to_html, _image_content_to_html, _image_content_to_html, _export_plotly_figure, _export_altair_chart, _export_bokeh_figure, _export_seaborn_figure