code: def test_remove_small_regions(affine_eye):
      data = np.array(
          [
              [[0.0, 1.0, 0.0], [0.0, 1.0, 1.0], [0.0, 0.0, 0.0]],
              [[0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0]],
              [[0.0, 0.0, 1.0], [1.0, 0.0, 0.0], [0.0, 1.0, 1.0]],
          ]
      )
      # To remove small regions, data should be labelled
      label_map, n_labels = label(data)
      sum_label_data = np.sum(label_map)
  
      min_size = 10
      # data can be act as mask_data to identify regions in label_map because
      # features in label_map are built upon non-zeros in data
      index = np.arange(n_labels + 1)
      removed_data = _remove_small_regions(
          label_map, index, affine_eye, min_size
      )
      sum_removed_data = np.sum(removed_data)
  
      assert sum_removed_data < sum_label_data
  
imports: import numpy
  import pytest
  from nibabel import Nifti1Image
  from scipy.ndimage import label
  from nilearn._utils.data_gen import generate_labeled_regions, generate_maps
  from nilearn._utils.exceptions import DimensionError
  from nilearn.conftest import _affine_eye, _img_4d_zeros, _shape_3d_default
  from nilearn.image import get_data
  from nilearn.regions import RegionExtractor, connected_label_regions, connected_regions
  from nilearn.regions.region_extractor import _remove_small_regions, _threshold_maps_ratio
label_desc: Use image node_id 22 for calling a global function with example usage: test_remove_small_regions(affine_eye) without return types