'Init the RawMff class.'

@verbose
def __init__(self, input_fname, montage=None, eog=None, misc=None, include=None, exclude=None, preload=False, channel_naming='E%d', verbose=None):

    logger.info(('Reading    EGI    MFF    Header    from    %s...' % input_fname))
    egi_info = _read_header(input_fname)
    if (eog is None):
        eog = []
    if (misc is None):
        misc = np.where((np.array(egi_info['chan_type']) != 'eeg'))[0].tolist()
    logger.info('                Reading    events    ...')
    (egi_events, egi_info) = _read_events(input_fname, egi_info)
    gains = _get_gains(os.path.join(input_fname, egi_info['info_fname']))
    if ((egi_info['value_range'] != 0) and (egi_info['bits'] != 0)):
        cals = [(egi_info['value_range'] / (2 ** egi_info['bits'])) for i in range(len(egi_info['chan_type']))]
    else:
        cal_scales = {'uV': 1e-06, 'V': 1}
        cals = [cal_scales[t] for t in egi_info['chan_unit']]
    if ('gcal' in gains):
        cals *= gains['gcal']
    if ('ical' in gains):
        pass
    logger.info('                Assembling    measurement    info    ...')
    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))
        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_)])))
        events_ids = (np.arange(len(include_)) + 1)
        self._new_trigger = _combine_triggers(egi_events[include_], remapping=events_ids)
        self.event_id = dict(zip([e for e in event_codes if (e in include_names)], events_ids))
        if (self._new_trigger is not None):
            egi_events = np.vstack([egi_events, self._new_trigger])
    else:
        self.event_id = None
    info = _empty_info(egi_info['sfreq'])
    info['buffer_size_sec'] = 1.0
    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'] = np.array([my_timestamp], dtype=np.float32)
    ch_names = [(channel_naming % (i + 1)) for i in range(egi_info['n_channels'])]
    ch_names.extend(list(egi_info['event_codes']))
    if (self._new_trigger is not None):
        ch_names.append('STI    014')
    ch_coil = FIFF.FIFFV_COIL_EEG
    ch_kind = FIFF.FIFFV_EEG_CH
    cals = np.concatenate([cals, np.repeat(1, (((len(event_codes) + 1) + len(misc)) + len(eog)))])
    chs = _create_chs(ch_names, cals, ch_coil, ch_kind, eog, (), (), misc)
    chs = _read_locs(input_fname, chs, egi_info)
    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': 0, 'cal': cals[idx], 'kind': FIFF.FIFFV_STIM_CH, 'coil_type': FIFF.FIFFV_COIL_NONE, 'unit': FIFF.FIFF_UNIT_NONE})
    info['chs'] = chs
    info._update_redundant()
    _check_update_montage(info, montage)
    file_bin = os.path.join(input_fname, egi_info['eeg_fname'])
    egi_info['egi_events'] = egi_events
    self._filenames = [file_bin]
    self._raw_extras = [egi_info]
    super(RawMff, self).__init__(info, preload=preload, orig_format='float', filenames=[file_bin], last_samps=[(egi_info['n_samples'] - 1)], raw_extras=[egi_info], verbose=verbose)
