code: def test_arg_downsample_x(series, downsampler, index_type):
      series = series.copy()
      series.index = construct_index(series, index_type)
      for n_out in np.random.randint(100, len(series), 6):
          # make sure n is even (required for MinMax downsampler)
          n_out = n_out - (n_out % 2)
          indices = downsampler().arg_downsample(
              series.index.values, series.values, n_out=n_out
          )
          assert len(indices) <= n_out + (n_out % 2)
  
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 2 for calling a global function with example usage: test_arg_downsample_x(series, downsampler, index_type) without return types