code: def test_kmodes_sample_weights_validation(self):
      kmodes = KModes(n_clusters=4, init="Cao", random_state=42)
      sample_weight_too_few = [1] * (SOYBEAN.shape[0] - 1)
      with self.assertRaisesRegex(
          ValueError,
          "sample_weight should be of equal size as samples.",
      ):
          kmodes.fit_predict(
              SOYBEAN, sample_weight=sample_weight_too_few
          )
      sample_weight_negative = [-1] + [1] * (SOYBEAN.shape[0] - 1)
      with self.assertRaisesRegex(
          ValueError, "sample_weight elements should be positive."
      ):
          kmodes.fit_predict(
              SOYBEAN, sample_weight=sample_weight_negative
          )
      sample_weight_non_numerical = [None] + [1] * (
          SOYBEAN.shape[0] - 1
      )
      with self.assertRaisesRegex(
          ValueError,
          "sample_weight elements should either be int or floats.",
      ):
          kmodes.fit_predict(
              SOYBEAN, sample_weight=sample_weight_non_numerical
          )
  
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 26 for calling the TestKModes obj's underlying member method code with example usage: obj.test_kmodes_sample_weights_validation() without return types