code: def _first_hpi(fname):
      # Get the first HPI result
      with open(fname) as fid:
          for line in fid:
              line = line.strip()
              if (
                  any(x in line for x in ("FileVersion", "NumCoils"))
                  or not line
              ):
                  continue
              hpi = np.array(line.split(), float)
              break
          else:
              raise RuntimeError(f"Could not find valid HPI in {fname}")
      # t is the first entry
      assert hpi.ndim == 1
      hpi = hpi[1:]
      hpi.shape = (-1, 5)
      hpi /= 1000.0
      return hpi
  
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 7 for calling a global function with example usage: _first_hpi(fname) and returns: hpi