def reactToAMQPMessage(message, send_back):
if _instanceof(message, structures.AddUser):<EOL><INDENT>api.add_user(<EOL>username=message.username,<EOL>password=message.password<EOL>)<EOL>return True<EOL><DEDENT>elif _instanceof(message, structures.RemoveUser):<EOL><INDENT>api.remove_user(message.username)<EOL>return True<EOL><DEDENT>elif _instanceof(message, structures.ChangePassword):<EOL><INDENT>api.change_password(<EOL>username=message.username,<EOL>new_password=message.new_password<EOL>)<EOL>return True<EOL><DEDENT>elif _instanceof(message, structures.ListRegisteredUsers):<EOL><INDENT>return structures.Userlist(api.list_users())<EOL><DEDENT>elif _instanceof(message, structures.SetUserSettings):<EOL><INDENT>username = message.username<EOL>conf_dict = dict(message._asdict())<EOL>del conf_dict["<STR_LIT:username>"]<EOL>passwd_reader.save_user_config(<EOL>username,<EOL>conf_dict<EOL>)<EOL>conf_dict = passwd_reader.read_user_config(username)<EOL>conf_dict["<STR_LIT:username>"] = username<EOL>return structures.UserSettings(**conf_dict)<EOL><DEDENT>elif _instanceof(message, structures.GetUserSettings):<EOL><INDENT>conf_dict = passwd_reader.read_user_config(message.username)<EOL>conf_dict["<STR_LIT:username>"] = message.username<EOL>return structures.UserSettings(**conf_dict)<EOL><DEDENT>raise ValueError(<EOL>"<STR_LIT>" + str(type(message)) + "<STR_LIT>"<EOL>)<EOL>
React to given (AMQP) message. `message` is expected to be
:py:func:`collections.namedtuple` structure from :mod:`.structures` filled
with all necessary data.

Args:
    message (object): One of the request objects defined in
                      :mod:`.structures`.
    send_back (fn reference): Reference to function for responding. This is
              useful for progress monitoring for example. Function takes
              one parameter, which may be response structure/namedtuple, or
              string or whatever would be normally returned.

Returns:
    object: Response class from :mod:`structures`.

Raises:
    ValueError: if bad type of `message` structure is given.