code: def _read_header(fid):
      """Read EGI binary header."""
      version = np.fromfile(fid, "<i4", 1)[0]
  
      if version > 6 & ~np.bitwise_and(version, 6):
          version = version.byteswap().astype(np.uint32)
      else:
          raise ValueError(
              "Watchout. This does not seem to be a simple "
              "binary EGI file."
          )
  
      def my_fread(*x, **y):
          return int(np.fromfile(*x, **y)[0])
  
      info = dict(
          version=version,
          year=my_fread(fid, ">i2", 1),
          month=my_fread(fid, ">i2", 1),
          day=my_fread(fid, ">i2", 1),
          hour=my_fread(fid, ">i2", 1),
          minute=my_fread(fid, ">i2", 1),
          second=my_fread(fid, ">i2", 1),
          millisecond=my_fread(fid, ">i4", 1),
          samp_rate=my_fread(fid, ">i2", 1),
          n_channels=my_fread(fid, ">i2", 1),
          gain=my_fread(fid, ">i2", 1),
          bits=my_fread(fid, ">i2", 1),
          value_range=my_fread(fid, ">i2", 1),
      )
  
      unsegmented = 1 if np.bitwise_and(version, 1) == 0 else 0
      precision = np.bitwise_and(version, 6)
      if precision == 0:
          raise RuntimeError("Floating point precision is undefined.")
  
      if unsegmented:
          info.update(
              dict(
                  n_categories=0,
                  n_segments=1,
                  n_samples=int(np.fromfile(fid, ">i4", 1)[0]),
                  n_events=int(np.fromfile(fid, ">i2", 1)[0]),
                  event_codes=[],
                  category_names=[],
                  category_lengths=[],
                  pre_baseline=0,
              )
          )
          for event in range(info["n_events"]):
              event_codes = "".join(
                  np.fromfile(fid, "S1", 4).astype("U1")
              )
              info["event_codes"].append(event_codes)
      else:
          raise NotImplementedError(
              "Only continuous files are supported"
          )
      info["unsegmented"] = unsegmented
      info["dtype"], info["orig_format"] = {
          2: (">i2", "short"),
          4: (">f4", "float"),
          6: (">f8", "double"),
      }[precision]
      info["dtype"] = np.dtype(info["dtype"])
      return info
  
file_path: mne-python/mne/io/egi/egi.py
imports: import datetime
  import time
  import numpy
  from ..._fiff.constants import FIFF
  from ..._fiff.meas_info import _empty_info
  from ..._fiff.utils import _create_chs, _read_segments_file
  from ...utils import _check_fname, _validate_type, logger, verbose, warn
  from ..base import BaseRaw
  from .egimff import _read_raw_egi_mff
  from .events import _combine_triggers
label_desc: Use image node_id 1 for calling a global function with example usage: _read_header(fid) and returns: info, int