code: def test_balanced_sampling_n_samples(self):
      y = [0] * 25 + [1] * 25 + [2] * 25 + [3] * 25
  
      indices = balanced_sampling(y, n_samples=30)
      counts = np.bincount(np.array([y[i] for i in indices]))
      self.assertEqual(30, len(indices))
      self.assertEqual(4, len(counts))
      self.assertEqual(4, len(counts[counts >= 7]))
  
file_path: small-text/tests/unit/small_text/data/test_sampling.py
imports: import unittest
  import numpy
  from small_text.data import balanced_sampling, stratified_sampling
  from small_text.data.sampling import _get_class_histogram
label_desc: Use image node_id 3 for calling the BalancedSamplingTest obj's underlying member method code with example usage: obj.test_balanced_sampling_n_samples() without return types