code: def test_connected_label_regions(labels_img):
      labels_data = get_data(labels_img)
      n_labels_without_region_extraction = len(np.unique(labels_data))
  
      # extract region without specifying min_size
      extracted_regions_on_labels_img = connected_label_regions(
          labels_img
      )
      extracted_regions_labels_data = get_data(
          extracted_regions_on_labels_img
      )
      n_labels_without_min = len(
          np.unique(extracted_regions_labels_data)
      )
  
      assert n_labels_without_region_extraction < n_labels_without_min
  
      # with specifying min_size
      extracted_regions_with_min = connected_label_regions(
          labels_img, min_size=100
      )
      extracted_regions_with_min_data = get_data(
          extracted_regions_with_min
      )
      n_labels_with_min = len(
          np.unique(extracted_regions_with_min_data)
      )
  
      assert n_labels_without_min > n_labels_with_min
  
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 23 for calling a global function with example usage: test_connected_label_regions(labels_img) without return types