code: def test_check_neighbors_object():
      name = "n_neighbors"
      n_neighbors = 1
      estimator = check_neighbors_object(name, n_neighbors)
      assert issubclass(type(estimator), KNeighborsMixin)
      assert estimator.n_neighbors == 1
      estimator = check_neighbors_object(name, n_neighbors, 1)
      assert issubclass(type(estimator), KNeighborsMixin)
      assert estimator.n_neighbors == 2
      estimator = NearestNeighbors(n_neighbors=n_neighbors)
      estimator_cloned = check_neighbors_object(name, estimator)
      assert estimator.n_neighbors == estimator_cloned.n_neighbors
      estimator = _CustomNearestNeighbors()
      estimator_cloned = check_neighbors_object(name, estimator)
      assert isinstance(estimator_cloned, _CustomNearestNeighbors)
  
imports: from collections import Counter, OrderedDict
  import numpy
  import pytest
  from sklearn.cluster import KMeans
  from sklearn.neighbors import NearestNeighbors
  from sklearn.neighbors._base import KNeighborsMixin
  from sklearn.utils._testing import assert_array_equal
  from imblearn.utils import check_neighbors_object, check_sampling_strategy, check_target_type
  from imblearn.utils._validation import ArraysTransformer, _deprecate_positional_args, _is_neighbors_object
  from imblearn.utils.testing import _CustomNearestNeighbors
label_desc: Use image node_id 1 for calling a global function with example usage: test_check_neighbors_object() without return types