code: def test_compasibility_when_registered(registering_cleanup):
      fr = FigureResampler
      fwr = FigureWidgetResampler
  
      fig_orig_1 = px.scatter(y=np.arange(1_005))
      fig_orig_2 = go.FigureWidget(
          {"type": "scatter", "y": np.arange(1_005)}
      )
      for fig in [fig_orig_1, fig_orig_2]:
          fig1 = fr(fig)
          fig2 = fr(fwr(fig))
          fig3 = fr(fr(fr(fr(fwr(fwr(fr(fwr(fr(fig)))))))))
          for f in [fig1, fig2, fig3]:
              assert isinstance(f, FigureResampler)
              assert len(f.data) == 1
              assert len(f.data[0].y) == 1000
              assert len(f.hf_data) == 1
              assert len(f.hf_data[0]["y"]) == 1005
  
          fig1 = fwr(fig)
          fig2 = fwr(fr(fig))
          fig3 = fwr(fwr(fwr(fwr(fr(fr(fwr(fr(fwr(fig)))))))))
          for f in [fig1, fig2, fig3]:
              assert isinstance(f, FigureWidgetResampler)
              assert len(f.data) == 1
              assert len(f.data[0].y) == 1000
              assert len(f.hf_data) == 1
              assert len(f.hf_data[0]["y"]) == 1005
  
      register_plotly_resampler()
  
      fig_orig_1 = px.scatter(y=np.arange(1_005))
      fig_orig_2 = go.FigureWidget(
          {"type": "scatter", "y": np.arange(1_005)}
      )
      for fig in [fig_orig_1, fig_orig_2]:
          fig1 = fr(fig)
          fig2 = fr(fwr(fig))
          fig3 = fr(fr(fr(fr(fwr(fwr(fr(fwr(fr(fig)))))))))
          for f in [fig1, fig2, fig3]:
              assert isinstance(f, FigureResampler)
              assert len(f.data) == 1
              assert len(f.data[0].y) == 1000
              assert len(f.hf_data) == 1
              assert len(f.hf_data[0]["y"]) == 1005
  
          fig1 = fwr(fig)
          fig2 = fwr(fr(fig))
          fig3 = fwr(fwr(fwr(fwr(fr(fr(fwr(fr(fwr(fig)))))))))
          for f in [fig1, fig2, fig3]:
              assert isinstance(f, FigureWidgetResampler)
              assert len(f.data) == 1
              assert len(f.data[0].y) == 1000
              assert len(f.hf_data) == 1
              assert len(f.hf_data[0]["y"]) == 1005
  
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 6 for calling a global function with example usage: test_compasibility_when_registered(registering_cleanup) without return types