class_docstr: Raw object from EGI simple binary file.
class_docstr_tok: ["Raw","object","from","EGI","simple","binary","file","."]
code: def __init__(
      self,
      input_fname,
      eog=None,
      misc=None,
      include=None,
      exclude=None,
      preload=False,
      channel_naming="E%d",
      verbose=None,
  ):
      input_fname = str(
          _check_fname(input_fname, "read", True, "input_fname")
      )
      if eog is None:
          eog = []
      if misc is None:
          misc = []
      with open(input_fname, "rb") as fid:  # 'rb' important for py3k
          logger.info("Reading EGI header from %s..." % input_fname)
          egi_info = _read_header(fid)
          logger.info("    Reading events ...")
          egi_events = _read_events(fid, egi_info)  # update info + jump
          if egi_info["value_range"] != 0 and egi_info["bits"] != 0:
              cal = egi_info["value_range"] / 2.0 ** egi_info["bits"]
          else:
              cal = 1e-6
  
      logger.info("    Assembling measurement info ...")
  
      event_codes = []
      if egi_info["n_events"] > 0:
          event_codes = list(egi_info["event_codes"])
          if include is None:
              exclude_list = (
                  ["sync", "TREV"] if exclude is None else exclude
              )
              exclude_inds = [
                  i
                  for i, k in enumerate(event_codes)
                  if k in exclude_list
              ]
              more_excludes = []
              if exclude is None:
                  for ii, event in enumerate(egi_events):
                      if event.sum() <= 1 and event_codes[ii]:
                          more_excludes.append(ii)
              if len(exclude_inds) + len(more_excludes) == len(
                  event_codes
              ):
                  warn(
                      "Did not find any event code with more than one "
                      "event.",
                      RuntimeWarning,
                  )
              else:
                  exclude_inds.extend(more_excludes)
  
              exclude_inds.sort()
              include_ = [
                  i
                  for i in np.arange(egi_info["n_events"])
                  if i not in exclude_inds
              ]
              include_names = [
                  k for i, k in enumerate(event_codes) if i in include_
              ]
          else:
              include_ = [
                  i for i, k in enumerate(event_codes) if k in include
              ]
              include_names = include
  
          for kk, v in [
              ("include", include_names),
              ("exclude", exclude),
          ]:
              if isinstance(v, list):
                  for k in v:
                      if k not in event_codes:
                          raise ValueError(
                              'Could find event named "%s"' % k
                          )
              elif v is not None:
                  raise ValueError(
                      "`%s` must be None or of type list" % kk
                  )
  
          event_ids = np.arange(len(include_)) + 1
          logger.info('    Synthesizing trigger channel "STI 014" ...')
          logger.info(
              "    Excluding events {%s} ..."
              % ", ".join(
                  [
                      k
                      for i, k in enumerate(event_codes)
                      if i not in include_
                  ]
              )
          )
          egi_info["new_trigger"] = _combine_triggers(
              egi_events[include_], remapping=event_ids
          )
          self.event_id = dict(
              zip(
                  [e for e in event_codes if e in include_names],
                  event_ids,
              )
          )
      else:
          # No events
          self.event_id = None
          egi_info["new_trigger"] = None
      info = _empty_info(egi_info["samp_rate"])
      my_time = datetime.datetime(
          egi_info["year"],
          egi_info["month"],
          egi_info["day"],
          egi_info["hour"],
          egi_info["minute"],
          egi_info["second"],
      )
      my_timestamp = time.mktime(my_time.timetuple())
      info["meas_date"] = (my_timestamp, 0)
      ch_names = [
          channel_naming % (i + 1)
          for i in range(egi_info["n_channels"])
      ]
      ch_names.extend(list(egi_info["event_codes"]))
      if egi_info["new_trigger"] is not None:
          ch_names.append("STI 014")  # our new_trigger
      nchan = len(ch_names)
      cals = np.repeat(cal, nchan)
      ch_coil = FIFF.FIFFV_COIL_EEG
      ch_kind = FIFF.FIFFV_EEG_CH
      chs = _create_chs(
          ch_names, cals, ch_coil, ch_kind, eog, (), (), misc
      )
      sti_ch_idx = [
          i
          for i, name in enumerate(ch_names)
          if name.startswith("STI") or name in event_codes
      ]
      for idx in sti_ch_idx:
          chs[idx].update(
              {
                  "unit_mul": FIFF.FIFF_UNITM_NONE,
                  "cal": 1.0,
                  "kind": FIFF.FIFFV_STIM_CH,
                  "coil_type": FIFF.FIFFV_COIL_NONE,
                  "unit": FIFF.FIFF_UNIT_NONE,
                  "loc": np.zeros(12),
              }
          )
      info["chs"] = chs
      info._unlocked = False
      info._update_redundant()
      orig_format = (
          egi_info["orig_format"]
          if egi_info["orig_format"] != "float"
          else "single"
      )
      super().__init__(
          info,
          preload,
          orig_format=orig_format,
          filenames=[input_fname],
          last_samps=[egi_info["n_samples"] - 1],
          raw_extras=[egi_info],
          verbose=verbose,
      )
  
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 to create a new RawEGI object from inherited base classes: BaseRaw with example: obj = RawEGI(input_fname, eog, misc, include, exclude, preload, channel_naming, verbose)