def is_valid_key(key):
 if (PY3 and isinstance(key, bytes)):
  raise TypeError('needs to be str not bytes')
 for c in key:
  if ((c < ' ') or (c > '}') or (c == '=')):
   return False
 else:
  return bool(key)

def is_valid_key ( key ) : if ( PY3 and isinstance ( key , bytes ) ) : raise TypeError ( 'needs to be str not bytes' ) for c in key : if ( ( c < ' ' ) or ( c > '}' ) or ( c == '=' ) ) : return False else : return bool ( key )
return true if a string is a valid vorbis comment key .