def register_mode(name, mode):
 if (name in predefined_modes):
  raise ValueError(('Mode name already taken: %s' % name))
 predefined_modes[name] = mode

def register_mode ( name , mode ) : if ( name in predefined_modes ) : raise ValueError ( ( 'Mode name already taken: %s' % name ) ) predefined_modes [ name ] = mode
add a mode which can be referred to by name in function .