docstr: Test whether centroid definition remains unchanged when scaling uniformly.
code: def test_k_modes_sample_weight_unchanged(self):
      """Test whether centroid definition remains unchanged when scaling uniformly."""
      kmodes_baseline = KModes(
          n_clusters=4, init="Cao", random_state=42
      )
      model_baseline = kmodes_baseline.fit(SOYBEAN)
      expected = set(
          tuple(row) for row in model_baseline.cluster_centroids_
      )
      for weight in [0.5, 1, 1.0, 2]:
          sample_weight = [weight] * SOYBEAN.shape[0]
          kmodes_weighted = KModes(
              n_clusters=4, init="Cao", random_state=42
          )
          model_weighted = kmodes_weighted.fit(
              SOYBEAN, sample_weight=sample_weight
          )
          factual = set(
              tuple(row) for row in model_weighted.cluster_centroids_
          )
          # Centroids might be ordered differently. To compare the centroids, we first
          # sort them.
          tuple_pairs = zip(sorted(expected), sorted(factual))
          for tuple_expected, tuple_factual in tuple_pairs:
              self.assertAlmostEqual(tuple_expected, tuple_factual)
  
imports: import pickle
  import unittest
  import numpy
  import pandas
  from kmodes.kmodes import KModes
  from kmodes.util.dissim import ng_dissim, jaccard_dissim_binary, jaccard_dissim_label
label_desc: Use image node_id 28 for calling the TestKModes obj's underlying member method code with example usage: obj.test_k_modes_sample_weight_unchanged() without return types