code: def _get_aseg(aseg, subject, subjects_dir):
      """Check that the anatomical segmentation file exists and load it."""
      nib = _import_nibabel("load aseg")
      subjects_dir = Path(
          get_subjects_dir(subjects_dir, raise_error=True)
      )
      if not aseg.endswith("aseg"):
          raise RuntimeError(
              f'`aseg` file path must end with "aseg", got {aseg}'
          )
      aseg = _check_fname(
          subjects_dir / subject / "mri" / (aseg + ".mgz"),
          overwrite="read",
          must_exist=True,
      )
      aseg = nib.load(aseg)
      aseg_data = np.array(aseg.dataobj)
      return aseg, aseg_data
  
imports: import os.path
  from gzip import GzipFile
  from pathlib import Path
  import numpy
  from ._fiff.constants import FIFF
  from ._fiff.meas_info import read_fiducials
  from .surface import _read_mri_surface, read_surface
  from .transforms import Transform, _ensure_trans, apply_trans, combine_transforms, invert_transform, read_ras_mni_t
  from .utils import _check_fname, _check_option, _import_nibabel, _validate_type, get_subjects_dir, logger, verbose
label_desc: Use image node_id 2 for calling a global function with example usage: _get_aseg(aseg, subject, subjects_dir) and returns: aseg,  aseg_data