code: def is_figurewidget(figure: Any):
      """Check if the figure is a plotly go.FigureWidget or a FigureWidgetResampler.
  
      !!! note
  
          This method does not use isinstance(figure, go.FigureWidget) as this will not
          work when go.FigureWidget is decorated (after executing the
          ``register_plotly_resampler`` function).
  
      Parameters
      ----------
      figure : Any
          The figure to check.
  
      Returns
      -------
      bool
          True if the figure is a plotly go.FigureWidget or a FigureWidgetResampler.
      """
      return isinstance(figure, BaseFigureWidget)
  
file_path: plotly-resampler/plotly_resampler/figure_resampler/utils.py
imports: import math
  import pandas
  from plotly.basedatatypes import BaseFigure
  from typing import Any
label_desc: Use image node_id 2 for calling a global function with example usage: is_figurewidget(figure) and returns: isinstance