def _hid_match(event_id, keys):
 keys = ([keys] if (not isinstance(keys, (list, tuple))) else keys)
 use_keys = []
 for key in keys:
  if (not isinstance(key, string_types)):
   raise KeyError(('keys must be strings, got %s (%s)' % (type(key), key)))
  use_keys.extend((k for k in event_id.keys() if set(key.split('/')).issubset(k.split('/'))))
 if (len(use_keys) == 0):
  raise KeyError(('Event "%s" is not in Epochs.' % key))
 use_keys = list(set(use_keys))
 return use_keys

def _hid_match ( event_id , keys ) : keys = ( [ keys ] if ( not isinstance ( keys , ( list , tuple ) ) ) else keys ) use_keys = [ ] for key in keys : if ( not isinstance ( key , string_types ) ) : raise KeyError ( ( 'keys must be strings, got %s (%s)' % ( type ( key ) , key ) ) ) use_keys . extend ( ( k for k in event_id . keys ( ) if set ( key . split ( '/' ) ) . issubset ( k . split ( '/' ) ) ) ) if ( len ( use_keys ) == 0 ) : raise KeyError ( ( 'Event "%s" is not in Epochs.' % key ) ) use_keys = list ( set ( use_keys ) ) return use_keys
match event ids using hid selection .