code: def test_all_estimators():
      # check if the filtering is working with a list or a single string
      type_filter = "sampler"
      all_estimators(type_filter=type_filter)
      type_filter = ["sampler"]
      estimators = all_estimators(type_filter=type_filter)
      for estimator in estimators:
          # check that all estimators are sampler
          assert issubclass(estimator[1], SamplerMixin)
  
      # check that an error is raised when the type is unknown
      type_filter = "rnd"
      with pytest.raises(
          ValueError, match="Parameter type_filter must be 'sampler'"
      ):
          all_estimators(type_filter=type_filter)
  
imports: import numpy
  import pytest
  from sklearn.neighbors._base import KNeighborsMixin
  from imblearn.base import SamplerMixin
  from imblearn.utils.testing import _CustomNearestNeighbors, all_estimators
label_desc: Use image node_id 1 for calling a global function with example usage: test_all_estimators() without return types