code: def test_reproducibility_of_sample_selection_by_category():
      labels, _, min_num_samples_per_class, _, _ = _test_data()
  
      n_seeds = 5
      percentages = [20, 40, 60, 80, 100]
  
      for random_seed in range(n_seeds):
          for num_samples_to_select_per_class in range(
              1, min_num_samples_per_class + 1
          ):
              selected_sample_indices1 = common.select_samples_by_category(
                  sample_category_labels=labels,
                  random_seed=random_seed,
                  num_samples_per_category=num_samples_to_select_per_class,
              )
              selected_sample_indices2 = common.select_samples_by_category(
                  sample_category_labels=labels,
                  random_seed=random_seed,
                  num_samples_per_category=num_samples_to_select_per_class,
              )
              assert (
                  selected_sample_indices1 == selected_sample_indices2
              )
  
          for percentage in percentages:
              selected_sample_indices1 = (
                  common.select_samples_by_category(
                      sample_category_labels=labels,
                      random_seed=random_seed,
                      percentage_of_samples_per_category=percentage,
                  )
              )
  
              selected_sample_indices2 = (
                  common.select_samples_by_category(
                      sample_category_labels=labels,
                      random_seed=random_seed,
                      percentage_of_samples_per_category=percentage,
                  )
              )
              assert (
                  selected_sample_indices1 == selected_sample_indices2
              )
  
file_path: ml-cvnets/tests/data/datasets/utils/test_common.py
imports: import numpy
  import pytest
  from data.datasets.utils import common
label_desc: Use image node_id 5 for calling a global function with example usage: test_reproducibility_of_sample_selection_by_category() without return types