code: def test_kprototypes_sample_weights_validation(self):
      kproto = kprototypes.KPrototypes(
          n_clusters=4, init="Cao", verbose=2
      )
      sample_weight_too_few = [1] * 11
      with self.assertRaisesRegex(
          ValueError,
          "sample_weight should be of equal size as samples.",
      ):
          kproto.fit_predict(
              STOCKS,
              categorical=[1, 2],
              sample_weight=sample_weight_too_few,
          )
      sample_weight_negative = [-1] + [1] * 11
      with self.assertRaisesRegex(
          ValueError, "sample_weight elements should be positive."
      ):
          kproto.fit_predict(
              STOCKS,
              categorical=[1, 2],
              sample_weight=sample_weight_negative,
          )
      sample_weight_non_numerical = [None] + [1] * 11
      with self.assertRaisesRegex(
          ValueError,
          "sample_weight elements should either be int or floats.",
      ):
          kproto.fit_predict(
              STOCKS,
              categorical=[1, 2],
              sample_weight=sample_weight_non_numerical,
          )
  
imports: import pickle
  import unittest
  import numpy
  import pandas
  from kmodes import kprototypes
  from kmodes.tests.test_kmodes import assert_cluster_splits_equal
  from kmodes.util.dissim import ng_dissim
label_desc: Use image node_id 24 for calling the TestKProtoTypes obj's underlying member method code with example usage: obj.test_kprototypes_sample_weights_validation() without return types