code: def test_connected_label_regions_check_labels(labels_img):
      """Test the names of the brain regions given in labels."""
      # Test labels for 9 regions in n_regions
      labels = [f"region_{x}" for x in "abcdefghi"]
  
      # If labels are provided, first return will contain extracted labels image
      # and second return will contain list of new names generated based on same
      # name with assigned on both hemispheres for example.
      _, new_labels = connected_label_regions(
          labels_img, min_size=100, labels=labels
      )
      # The length of new_labels returned can differ depending upon min_size. If
      # min_size given is more small regions can be removed therefore newly
      # generated labels can be less than original size of labels. Or if min_size
      # is less then newly generated labels can be more.
  
      # We test here whether labels returned are empty or not.
      assert new_labels != ""
      assert len(new_labels) <= len(labels)
  
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 26 for calling a global function with example usage: test_connected_label_regions_check_labels(labels_img) without return types