code: def test_stratified_sampling_n_samples(self):
      y = np.array([0] * 25 + [1] * 25 + [2] * 25 + [3] * 25)
  
      indices = stratified_sampling(y, n_samples=30)
      counts = np.bincount(np.array([y[i] for i in indices]))
      self.assertEqual(30, len(indices))
      self.assertEqual(4, counts.shape[0])
      self.assertEqual(4, counts[counts >= 7].shape[0])
  
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 StratifiedSamplingTest obj's underlying member method code with example usage: obj.test_stratified_sampling_n_samples() without return types