code: def _check_correctly_serialized(
      fig: FigureResampler | FigureWidgetResampler,
      nb_traces: int,
      nb_samples: int,
  ):
      for i in range(nb_traces):
          trace = fig.data[i]
          assert isinstance(trace, go.Scattergl)
          assert len(trace.y) == 50
          assert len(trace.text) == 50
          assert len(trace.hovertext) == 50
          assert len(trace.marker.size) == 50
          assert len(trace.marker.color) == 50
          assert f"trace--{i}" in trace.name
          hf_trace = fig.hf_data[i]
          assert np.all(hf_trace["y"] == np.arange(nb_samples))
          assert np.all(
              hf_trace["text"] == np.arange(nb_samples).astype(str)
          )
          assert np.all(
              hf_trace["hovertext"]
              == np.arange(nb_samples).astype(str)[::-1]
          )
          assert np.all(
              hf_trace["marker_size"] == np.linspace(1, 10, nb_samples)
          )
          assert np.all(
              hf_trace["marker_color"]
              == np.log10(np.arange(nb_samples) + 1)
          )
  
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 2 for calling a global function with example usage: _check_correctly_serialized(fig, nb_traces, nb_samples) without return types