def _check_meg_type(meg, allow_auto=False):
 if isinstance(meg, string_types):
  allowed_types = ['grad', 'mag', 'planar1', 'planar2']
  allowed_types += (['auto'] if allow_auto else [])
  if (meg not in allowed_types):
   raise ValueError(('meg value must be one of %s or bool, not %s' % (allowed_types, meg)))

def _check_meg_type ( meg , allow_auto = False ) : if isinstance ( meg , string_types ) : allowed_types = [ 'grad' , 'mag' , 'planar1' , 'planar2' ] allowed_types += ( [ 'auto' ] if allow_auto else [ ] ) if ( meg not in allowed_types ) : raise ValueError ( ( 'meg value must be one of %s or bool, not %s' % ( allowed_types , meg ) ) )
ensure a valid meg type .