code: def cat_series_box_hist_figure() -> FigureResampler:
      # Create a categorical series, with mostly a's, but a few sparse b's and c's
      cats_list = np.array(list("aaaaaaaaaa" * 1000))
      cats_list[
          np.random.choice(len(cats_list), 100, replace=False)
      ] = "b"
      cats_list[
          np.random.choice(len(cats_list), 50, replace=False)
      ] = "c"
      cat_series = pd.Series(cats_list, dtype="category")
  
      x = np.arange(_nb_samples).astype(np.uint32)
      y = (
          np.sin(x / 300).astype(np.float32)
          + np.random.randn(_nb_samples) / 5
      )
      float_series = pd.Series(index=x, data=y)
  
      base_fig = make_subplots(
          rows=2,
          cols=2,
          specs=[[{}, {}], [{"colspan": 2}, None]],
      )
      fig = FigureResampler(
          base_fig, default_n_shown_samples=1000, verbose=True
      )
  
      fig.add_trace(
          go.Scattergl(
              name="cat_series", x=cat_series.index, y=cat_series
          ),
          row=1,
          col=1,
          hf_hovertext="text",
      )
  
      fig.add_trace(
          go.Box(x=float_series.values, name="float_series"),
          row=1,
          col=2,
      )
      fig.add_trace(
          go.Box(x=float_series.values**2, name="float_series**2"),
          row=1,
          col=2,
      )
  
      # add a not hf-trace
      fig.add_trace(
          go.Histogram(
              x=float_series,
              name="float_series",
          ),
          row=2,
          col=1,
      )
      return fig
  
imports: import os
  from typing import Union
  import numpy
  import pandas
  import plotly.graph_objects
  import pytest
  from plotly.subplots import make_subplots
  from plotly_resampler import LTTB, EveryNthPoint, FigureResampler, unregister_plotly_resampler
label_desc: Use image node_id 12 for calling a global function with example usage: cat_series_box_hist_figure() and returns: fig