code: def load_img(img, wildcards=True, dtype=None):
      """Load a Niimg-like object from filenames or list of filenames.
  
      .. versionadded:: 0.2.5
  
      Parameters
      ----------
      img : Niimg-like object
          If string, consider it as a path to NIfTI image and
          call `nibabel.load()`on it.
          The '~' symbol is expanded to the user home folder.
          If it is an object, check if affine attribute is present, raise
          `TypeError` otherwise.
          See :ref:`extracting_data`.
  
      wildcards : :obj:`bool`, default=True
          Use `img` as a regular expression to get a list of matching input
          filenames.
          If multiple files match, the returned list is sorted using an ascending
          order.
          If no file matches the regular expression, a `ValueError` exception is
          raised.
  
      dtype : {dtype, "auto"}, optional
          Data type toward which the data should be converted. If "auto", the
          data will be converted to int32 if dtype is discrete and float32 if it
          is continuous.
  
      Returns
      -------
      3D/4D Niimg-like object
          Result can be :class:`~nibabel.nifti1.Nifti1Image` or the input, as-is.
          It is guaranteed that
          the returned object has an affine attributes and that
          nilearn.image.get_data returns its data.
  
      """
      return check_niimg(img, wildcards=wildcards, dtype=dtype)
  
imports: import collections.abc
  import copy
  import itertools
  import warnings
  import nibabel
  import numpy
  from joblib import Memory, Parallel, delayed
  from scipy.ndimage import gaussian_filter1d, generate_binary_structure, label
  from scipy.stats import scoreatpercentile
  from ..None import signal
  from .._utils import _repr_niimgs, as_ndarray, check_niimg, check_niimg_3d, check_niimg_4d, fill_doc
  from .._utils.exceptions import DimensionError
  from .._utils.helpers import rename_parameters, stringify_path
  from .._utils.niimg import _get_data, safe_get_data
  from .._utils.niimg_conversions import _index_img, check_same_fov, iter_check_niimg
  from .._utils.param_validation import check_threshold
  from .._utils.path_finding import resolve_globbing
label_desc: Use image node_id 21 for calling a global function with example usage: load_img(img, wildcards, dtype) and returns: check_niimg