def _contains_ch_type(info, ch_type):
 if (not isinstance(ch_type, string_types)):
  raise ValueError('`ch_type` is of class {actual_class}. It must be `str`'.format(actual_class=type(ch_type)))
 meg_extras = ['mag', 'grad', 'planar1', 'planar2']
 fnirs_extras = ['hbo', 'hbr']
 valid_channel_types = sorted((([key for key in _PICK_TYPES_KEYS if (key != 'meg')] + meg_extras) + fnirs_extras))
 if (ch_type not in valid_channel_types):
  raise ValueError(('ch_type must be one of %s, not "%s"' % (valid_channel_types, ch_type)))
 if (info is None):
  raise ValueError(('Cannot check for channels of type "%s" because info is None' % (ch_type,)))
 return (ch_type in [channel_type(info, ii) for ii in range(info['nchan'])])

def _contains_ch_type ( info , ch_type ) : if ( not isinstance ( ch_type , string_types ) ) : raise ValueError ( '`ch_type` is of class {actual_class}. It must be `str`' . format ( actual_class = type ( ch_type ) ) ) meg_extras = [ 'mag' , 'grad' , 'planar1' , 'planar2' ] fnirs_extras = [ 'hbo' , 'hbr' ] valid_channel_types = sorted ( ( ( [ key for key in _PICK_TYPES_KEYS if ( key != 'meg' ) ] + meg_extras ) + fnirs_extras ) ) if ( ch_type not in valid_channel_types ) : raise ValueError ( ( 'ch_type must be one of %s, not "%s"' % ( valid_channel_types , ch_type ) ) ) if ( info is None ) : raise ValueError ( ( 'Cannot check for channels of type "%s" because info is None' % ( ch_type , ) ) ) return ( ch_type in [ channel_type ( info , ii ) for ii in range ( info [ 'nchan' ] ) ] )
check whether a certain channel type is in an info object .