'Do some self-consistency checks and datatype tweaks.'

def _check_consistency(self):

    missing = [bad for bad in self['bads'] if (bad not in self['ch_names'])]
    if (len(missing) > 0):
        raise RuntimeError(('bad    channel(s)    %s    marked    do    not    exist    in    info' % (missing,)))
    chs = [ch['ch_name'] for ch in self['chs']]
    if ((len(self['ch_names']) != len(chs)) or any(((ch_1 != ch_2) for (ch_1, ch_2) in zip(self['ch_names'], chs))) or (self['nchan'] != len(chs))):
        raise RuntimeError('info    channel    name    inconsistency    detected,    please    notify    mne-python    developers')
    for key in ('sfreq', 'highpass', 'lowpass'):
        if (self.get(key) is not None):
            self[key] = float(self[key])
    unique_ids = np.unique(self['ch_names'], return_index=True)[1]
    if (len(unique_ids) != self['nchan']):
        dups = set((self['ch_names'][x] for x in np.setdiff1d(range(self['nchan']), unique_ids)))
        warn(('Channel    names    are    not    unique,    found    duplicates    for:    %s.    Applying    running    numbers    for    duplicates.' % dups))
        for ch_stem in dups:
            overlaps = np.where((np.array(self['ch_names']) == ch_stem))[0]
            for (idx, ch_idx) in enumerate(overlaps):
                ch_name = (ch_stem + ('-%s' % idx))
                assert (ch_name not in self['ch_names'])
                self['ch_names'][ch_idx] = ch_name
                self['chs'][ch_idx]['ch_name'] = ch_name
    if ('filename' in self):
        warn('the    "filename"    key    is    misleading                                                                    and    info    should    not    have    it')
