code: def _read_nihon_annotations(fname):
      fname = _ensure_path(fname)
      log_fname = fname.with_suffix(".LOG")
      if not log_fname.exists():
          warn("No LOG file exists. Annotations will not be read")
          return dict(onset=[], duration=[], description=[])
      logger.info("Found LOG file, reading events.")
      with open(log_fname) as fid:
          version = np.fromfile(fid, "|S16", 1).astype("U16")[0]
          if version not in _valid_headers:
              raise ValueError(
                  f"Not a valid Nihon Kohden LOG file ({version})"
              )
  
          fid.seek(0x91)
          n_logblocks = np.fromfile(fid, np.uint8, 1)[0]
          all_onsets = []
          all_descriptions = []
          for t_block in range(n_logblocks):
              fid.seek(0x92 + t_block * 20)
              t_blk_address = np.fromfile(fid, np.uint32, 1)[0]
              fid.seek(t_blk_address + 0x12)
              n_logs = np.fromfile(fid, np.uint8, 1)[0]
              fid.seek(t_blk_address + 0x14)
              t_logs = np.fromfile(fid, "|S45", n_logs)
              for t_log in t_logs:
                  for enc in _encodings:
                      try:
                          t_log = t_log.decode(enc)
                      except UnicodeDecodeError:
                          pass
                      else:
                          break
                  else:
                      warn(
                          f"Could not decode log as one of {_encodings}"
                      )
                      continue
                  t_desc = t_log[:20].strip("\x00")
                  t_onset = datetime.strptime(t_log[20:26], "%H%M%S")
                  t_onset = (
                      t_onset.hour * 3600
                      + t_onset.minute * 60
                      + t_onset.second
                  )
                  all_onsets.append(t_onset)
                  all_descriptions.append(t_desc)
  
          annots = dict(
              onset=all_onsets,
              duration=[0] * len(all_onsets),
              description=all_descriptions,
          )
      return annots
  
imports: from collections import OrderedDict
  from datetime import datetime, timezone
  from pathlib import Path
  import numpy
  from ..._fiff.meas_info import create_info
  from ..._fiff.utils import _mult_cal_one
  from ...annotations import Annotations
  from ...utils import _check_fname, fill_doc, logger, verbose, warn
  from ..base import BaseRaw
label_desc: Use image node_id 6 for calling a global function with example usage: _read_nihon_annotations(fname) and returns: annots, dict