code: def test_wrap_aggregate_x_gaps(downsampler, series):
      series = series.copy()
      # Create a range-index with some gaps in it
      idx = np.arange(len(series))
      idx[1000:] += 1000
      idx[2000:] += 1500
      idx[8000:] += 2500
      series.index = idx
  
      x_agg, y_agg, indices = wrap_aggregate(
          hf_x=series.index,
          hf_y=series.values,
          downsampler=downsampler(),
          gap_handler=MedDiffGapHandler(),
          n_out=100,
      )
      assert len(x_agg) == len(y_agg) == len(indices)
      assert pd.Series(y_agg).isna().sum() == 3
  
imports: import numpy
  import pandas
  import pytest
  from pytest_lazyfixture import lazy_fixture
  from plotly_resampler.aggregation import LTTB, EveryNthPoint, FuncAggregator, MedDiffGapHandler, MinMaxAggregator, MinMaxLTTB, MinMaxOverlapAggregator, NoGapHandler
  from .utils import construct_index, wrap_aggregate
label_desc: Use image node_id 7 for calling a global function with example usage: test_wrap_aggregate_x_gaps(downsampler, series) without return types