code: def test_pickle_figurewidget_resampler(pickle_figure):
      nb_traces = 2
      nb_samples = 4_123
  
      fig = FigureWidgetResampler(default_n_shown_samples=50)
      for i in range(nb_traces):
          fig.add_trace(
              go.Scattergl(name=f"trace--{i}"),
              **_get_hf_props(nb_samples),
          )
  
      pickle.dump(fig, open(pickle_figure, "wb"))
      fig_pickle = pickle.load(open(pickle_figure, "rb"))
  
      assert isinstance(fig_pickle, FigureWidgetResampler)
      assert len(fig_pickle.data) == nb_traces
      assert len(fig_pickle.hf_data) == nb_traces
      _check_correctly_serialized(fig_pickle, nb_traces, nb_samples)
  
      # Test for figure with subplots (check non-pickled private properties)
      fig = FigureWidgetResampler(
          make_subplots(rows=2, cols=1, shared_xaxes=True),
          default_n_shown_samples=50,
      )
      for i in range(nb_traces):
          fig.add_trace(
              go.Scattergl(name=f"trace--{i}"),
              **_get_hf_props(nb_samples),
              row=(i % 2) + 1,
              col=1,
          )
      assert fig._global_n_shown_samples == 50
      assert fig._figure_class == go.FigureWidget
      assert fig._xaxis_list == ["xaxis", "xaxis2"]
      assert fig._yaxis_list == ["yaxis", "yaxis2"]
  
      pickle.dump(fig, open(pickle_figure, "wb"))
      fig_pickle = pickle.load(open(pickle_figure, "rb"))
  
      assert isinstance(fig_pickle, FigureWidgetResampler)
      assert fig_pickle._global_n_shown_samples == 50
      assert fig_pickle._figure_class == go.FigureWidget
      assert fig_pickle._xaxis_list == ["xaxis", "xaxis2"]
      assert fig_pickle._yaxis_list == ["yaxis", "yaxis2"]
      assert len(fig_pickle.data) == nb_traces
      assert len(fig_pickle.hf_data) == nb_traces
      _check_correctly_serialized(fig_pickle, nb_traces, nb_samples)
  
imports: from __future__ import annotations
  import copy
  import pickle
  import numpy
  import plotly.graph_objects
  from plotly.subplots import make_subplots
  from plotly_resampler import FigureResampler, FigureWidgetResampler
  from plotly_resampler.registering import register_plotly_resampler, unregister_plotly_resampler
  from .conftest import pickle_figure, registering_cleanup
label_desc: Use image node_id 4 for calling a global function with example usage: test_pickle_figurewidget_resampler(pickle_figure) without return types