code: def test_generator(seed):
      bs = IIDBootstrap(np.empty(100), seed=seed)
      typ = (
          RandomState
          if isinstance(seed, RandomState)
          else np.random.Generator
      )
      assert isinstance(bs.generator, typ)
      gen_copy = copy.deepcopy(bs.generator)
      bs.generator = gen_copy
      with pytest.raises(TypeError):
          bs.generator = 3
      assert isinstance(bs.generator, typ)
      assert bs.generator is gen_copy
      state = bs.state
      if isinstance(bs.generator, np.random.Generator):
          assert isinstance(state, dict)
      else:
          assert isinstance(state, tuple)
      bs.state = state
      with pytest.warns(FutureWarning):
          bs.set_state(state)
      with pytest.warns(FutureWarning):
          state = bs.get_state()
      if isinstance(bs.generator, np.random.Generator):
          assert isinstance(state, dict)
      else:
          assert isinstance(state, tuple)
      with pytest.warns(FutureWarning):
          assert isinstance(bs.random_state, typ)
          bs.random_state = bs.random_state
  
imports: from __future__ import annotations
  import copy
  from typing import Callable, NamedTuple
  import warnings
  import numpy
  from numpy.random import RandomState
  from numpy.testing import assert_allclose, assert_equal
  import pandas
  from pandas.testing import assert_frame_equal, assert_series_equal
  import pytest
  import scipy.stats
  from arch.bootstrap import CircularBlockBootstrap, IIDBootstrap, IndependentSamplesBootstrap, MovingBlockBootstrap, StationaryBootstrap
  from arch.bootstrap._samplers_python import stationary_bootstrap_sample
  from arch.bootstrap._samplers_python import stationary_bootstrap_sample_python
  from arch.bootstrap.base import _loo_jackknife
  from arch.utility.exceptions import StudentizationError
label_desc: Use image node_id 42 for calling a global function with example usage: test_generator(seed) without return types