code: def test_invalid_thresholds_in_threshold_maps_ratio(
      dummy_map, invalid_threshold
  ):
      with pytest.raises(
          ValueError,
          match="threshold given as ratio to the number of voxels must "
          "be Real number and should be positive "
          "and between 0 and total number of maps "
          f"i.e. n_maps={dummy_map.shape[-1]}. "
          f"You provided {invalid_threshold}",
      ):
          _threshold_maps_ratio(
              maps_img=dummy_map, threshold=invalid_threshold
          )
  
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 6 for calling a global function with example usage: test_invalid_thresholds_in_threshold_maps_ratio(dummy_map, invalid_threshold) without return types