def check_for_conversation_existence(alternate_return_value):
    """A decorator that checks for a conversations existence based on the inner
    functions given client_host and client_port. If it does exist, then run the
    original function, otherwise return the alternate return value.

    Three arguments are assumed of the wrapped function:
        self: The containing ConversationTable
        client_host: A hostname or ip address of the client.
        client_port: The port from which the client is connecting.

    Args:
        alternate_return_value: What to return if the TFTPConversation doesn't
        exist.
    """
    def decorator_outer(function):
        def decorator_inner(self, client_host, client_port, *args):
            if (client_host, client_port) in self.conversation_table:
                return function(self, client_host, client_port, *args)
            else:
                return alternate_return_value

        return decorator_inner

    return decorator_outer