code: def test_ssc_fbs_sampler(
      num_repeats: int,
      trunc_ra_sampler: bool,
      crop_size_h: int,
      crop_size_w: int,
  ) -> None:
      """Test for single-scale fixed batch size sampler with and without repeated augmentation."""
  
      opts = get_config(
          config_file="tests/data/samplers/test_batch_sampler_config.yaml"
      )
  
      set_common_defaults(opts)
  
      # set repeated augmentation related hyper-parameters
      setattr(opts, "sampler.num_repeats", num_repeats)
      setattr(
          opts, "sampler.truncated_repeat_aug_sampler", trunc_ra_sampler
      )
  
      # we over-ride the spatial sizes for testing different cases
      setattr(opts, "sampler.bs.crop_size_height", crop_size_h)
      setattr(opts, "sampler.bs.crop_size_width", crop_size_w)
  
      sampler = build_sampler(
          opts, n_data_samples=N_DATA_SAMPLES, is_training=True
      )
      assert hasattr(sampler, "crop_size_h")
      assert hasattr(sampler, "crop_size_w")
      assert sampler.crop_size_h == crop_size_h
      assert sampler.crop_size_w == crop_size_w
  
      # repeated sample test
      np.testing.assert_equal(
          len(sampler),
          N_DATA_SAMPLES * (1 if trunc_ra_sampler else num_repeats),
      )
  
file_path: ml-cvnets/tests/data/samplers/test_data_samplers.py
imports: import argparse
  from typing import Optional
  import numpy
  import pytest
  from data.sampler import build_sampler
  from tests.configs import get_config
label_desc: Use image node_id 2 for calling a global function with example usage: test_ssc_fbs_sampler(num_repeats, trunc_ra_sampler, crop_size_h, crop_size_w) without return types