code: def test_register_and_unregister_graph_objects(registering_cleanup):
      import plotly.graph_objects as go_
  
      # Is unregistered now
      assert not (
          isfunction(go_.Figure) or isfunction(go_.FigureWidget)
      )
      fig = go_.Figure()
      assert not isinstance(fig, AbstractFigureAggregator)
      fig = go_.FigureWidget()
      assert not isinstance(fig, AbstractFigureAggregator)
  
      register_plotly_resampler()
      assert isfunction(go_.Figure) and isfunction(go_.FigureWidget)
      fig = go_.Figure()
      assert isinstance(fig, AbstractFigureAggregator)
      assert isinstance(fig, FigureResampler)
      assert not isinstance(fig, FigureWidgetResampler)
      fig = go_.FigureWidget()
      assert isinstance(fig, AbstractFigureAggregator)
      assert isinstance(fig, FigureWidgetResampler)
      assert not isinstance(fig, FigureResampler)
  
      unregister_plotly_resampler()
      assert not (
          isfunction(go_.Figure) or isfunction(go_.FigureWidget)
      )
      fig = go_.Figure()
      assert not isinstance(fig, AbstractFigureAggregator)
      fig = go_.FigureWidget()
      assert not isinstance(fig, AbstractFigureAggregator)
  
file_path: plotly-resampler/tests/test_registering.py
imports: from inspect import isfunction
  import numpy
  import plotly.express
  import plotly.graph_objects
  from plotly_resampler import FigureResampler, FigureWidgetResampler
  from plotly_resampler.figure_resampler.figure_resampler_interface import AbstractFigureAggregator
  from plotly_resampler.registering import _get_plotly_constr, register_plotly_resampler, unregister_plotly_resampler
  from .conftest import registering_cleanup
label_desc: Use image node_id 2 for calling a global function with example usage: test_register_and_unregister_graph_objects(registering_cleanup) without return types