code: def test_connected_label_regions_check_labels_string_without_list(
      labels_img, affine_eye, shape_3d_default
  ):
      """If labels (or names to regions) given is a string without a list \
      we expect it to be split to regions extracted and returned as list."""
      labels_in_str = "region_a"
      labels_img_in_str = generate_labeled_regions(
          shape=shape_3d_default, affine=affine_eye, n_regions=1
      )
      _, new_labels = connected_label_regions(
          labels_img_in_str, labels=labels_in_str
      )
  
      assert isinstance(new_labels, list)
  
      # If user has provided combination of labels, then function passes without
      # breaking and new labels are returned based upon given labels and should
      # be equal or more based on regions extracted
      combined_labels = [
          "region_a",
          "1",
          "region_b",
          "2",
          "region_c",
          "3",
          "region_d",
          "4",
          "region_e",
      ]
      _, new_labels = connected_label_regions(
          labels_img, labels=combined_labels
      )
  
      assert len(new_labels) >= len(combined_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 29 for calling a global function with example usage: test_connected_label_regions_check_labels_string_without_list(labels_img, affine_eye, shape_3d_default) without return types