code: def test_kmeans_and_kmeans2_random_seed(self):
      seed_list = [1234, np.random.RandomState(1234)]
  
      # check that np.random.Generator can be used (numpy >= 1.17)
      if hasattr(np.random, "default_rng"):
          seed_list.append(np.random.default_rng(1234))
  
      for seed in seed_list:
          # test for kmeans
          res1, _ = kmeans(TESTDATA_2D, 2, seed=seed)
          res2, _ = kmeans(TESTDATA_2D, 2, seed=seed)
          assert_allclose(res1, res1)  # should be same results
  
          # test for kmeans2
          for minit in ["random", "points", "++"]:
              res1, _ = kmeans2(TESTDATA_2D, 2, minit=minit, seed=seed)
              res2, _ = kmeans2(TESTDATA_2D, 2, minit=minit, seed=seed)
              assert_allclose(res1, res1)
  
imports: import warnings
  import sys
  import numpy
  from numpy.testing import assert_array_equal, assert_array_almost_equal, assert_allclose, assert_equal, assert_, suppress_warnings
  import pytest
  from pytest import raises
  from scipy.cluster.vq import kmeans, kmeans2, py_vq, vq, whiten, ClusterError, _krandinit
  from scipy.cluster import _vq
  from scipy.sparse.sputils import matrix
label_desc: Use image node_id 15 for calling the TestKMean obj's underlying member method code with example usage: obj.test_kmeans_and_kmeans2_random_seed() without return types