def _check_consistency(self):
        """Do some self-consistency checks and datatype tweaks"""
        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')

        # make sure we have the proper datatypes
        for key in ('sfreq', 'highpass', 'lowpass'):
            if self.get(key) is not None:
                self[key] = float(self[key])

        # make sure channel names are unique
        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))
            raise RuntimeError('Channel names are not unique, found '
                               'duplicates for: %s' % dups)
dataset/ETHPy150Open mne-tools/mne-python/mne/io/meas_info.py/Info._check_consistency/original