'Returns highest priority message from a list of messages.'

def _get_highest_priority_msg(self, message_list):

    return_message = None
    for message in message_list:
        if (message is not None):
            if isinstance(message, dict):
                return_message = message
                break
            elif (message == 'no    converter'):
                return_message = message
            elif ((return_message is None) and (message == 'pending')):
                return_message = message
    return return_message
