code: def test_crp_generator_generate_batch(self, n, batch_size, alpha):
      crp_generator = partition.CRPGenerator(alpha=alpha)
      partitions = crp_generator.generate_batch(n, batch_size)
      self.assertLen(partitions, batch_size)
      partition_sums = np.array([pt.sum() for pt in partitions])
      np.testing.assert_array_equal(
          partition_sums, np.array([n] * batch_size)
      )
      invalid_partitions = np.array(
          [np.sum(pt < 1) for pt in partitions]
      )
      np.testing.assert_array_equal(
          invalid_partitions, np.zeros(batch_size)
      )
  
file_path: neural-structured-learning/research/neural_clustering/data_generators/partition_test.py
imports: from absl.testing import absltest
  from absl.testing import parameterized
  from neural_clustering.data_generators import partition
  import numpy
label_desc: Use image node_id 1 for calling the PartitionTest obj's underlying member method code with example usage: obj.test_crp_generator_generate_batch(n, batch_size, alpha) without return types