class_docstr: Testing the DATA_LIMIT underlying sub sampling methods
code: def test_balanced_sub_sampling(self) -> None:
      labels = np.array([0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 0])
      unique_labels = set(labels)
  
      indices1 = balanced_sub_sampling(
          labels, num_samples=8, skip_samples=0
      )
      values, counts = np.unique(labels[indices1], return_counts=True)
      self.assertEqual(8, len(indices1))
      self.assertEqual(
          set(values),
          set(unique_labels),
          "at least one of each label should be selected",
      )
      self.assertEqual(
          2, np.min(counts), "at least two of each label is selected"
      )
      self.assertEqual(
          2, np.max(counts), "at most two of each label is selected"
      )
  
      indices2 = balanced_sub_sampling(
          labels, num_samples=8, skip_samples=4
      )
      self.assertEqual(8, len(indices2))
      self.assertEqual(
          4,
          len(set(indices1) & set(indices2)),
          "skipping samples should slide the window",
      )
  
imports: import unittest
  import numpy
  from vissl.data.data_helper import balanced_sub_sampling, unbalanced_sub_sampling
label_desc: Use image node_id 2 for calling the TestDataLimitSubSampling obj's underlying member method code with example usage: obj.test_balanced_sub_sampling() without return types