code: def _get_curry_file_structure(fname, required=()):
      """Store paths to a dict and check for required files."""
      _msg = (
          "The following required files cannot be found: {0}.\nPlease make "
          "sure all required files are located in the same directory as {1}."
      )
      fname = Path(_check_fname(fname, "read", True, "fname"))
  
      # we don't use os.path.splitext to also handle extensions like .cdt.dpa
      # this won't handle a dot in the filename, but it should handle it in
      # the parent directories
      fname_base = fname.name.split(".", maxsplit=1)[0]
      ext = fname.name[len(fname_base) :]
      fname_base = str(fname)
      fname_base = fname_base[: len(fname_base) - len(ext)]
      del fname
      version = _get_curry_version(ext)
      my_curry = dict()
      for key in (
          "info",
          "data",
          "labels",
          "events_cef",
          "events_ceo",
          "hpi",
      ):
          fname = fname_base + FILE_EXTENSIONS[version][key]
          if op.isfile(fname):
              _key = "events" if key.startswith("events") else key
              my_curry[_key] = fname
  
      missing = [field for field in required if field not in my_curry]
      if missing:
          raise FileNotFoundError(
              _msg.format(np.unique(missing), fname)
          )
  
      return my_curry
  
imports: import os.path
  import re
  from collections import namedtuple
  from datetime import datetime, timezone
  from pathlib import Path
  import numpy
  from ..._fiff._digitization import _make_dig_points
  from ..._fiff.constants import FIFF
  from ..._fiff.meas_info import create_info
  from ..._fiff.tag import _coil_trans_to_loc
  from ..._fiff.utils import _mult_cal_one, _read_segments_file
  from ...annotations import Annotations
  from ...surface import _normal_orth
  from ...transforms import Transform, _angle_between_quats, apply_trans, combine_transforms, get_ras_to_neuromag_trans, invert_transform, rot_to_quat
  from ...utils import _check_fname, check_fname, logger, verbose
  from ..base import BaseRaw
  from ..ctf.trans import _quaternion_align
label_desc: Use image node_id 2 for calling a global function with example usage: _get_curry_file_structure(fname, required) and returns: my_curry