def set_message(data):
    """
    Set status and message on the given dictionary.
    The message is translated according to the hash map.

    :param data: status and message hash/key pair
    :type data: dict
    :returns: the passed dict with "message" or "errors" field updated
    """
    success = data['success']
    message = ""
    if success:
        if 'message' in data and len(data['message']) == 2:
            hash_map = data['message'][0]
            message_code = data['message'][1]
            data['message'] = getattr(g, hash_map)(message_code)
    else:
        if 'errors' in data and len(data['errors']) == 0:
            error_tuple = data['errors'][0].get('code')
            if error_tuple and len(error_tuple) == 2:
                hash_map = error_tuple[0]
                error_code = error_tuple[1]
                data['errors'][0]['code'] = error_code
                data['errors'][0]['message'] = getattr(g, hash_map)(error_code)
    return data
dataset/ETHPy150Open Opentaste/bombolone/bombolone/core/utils/message.py/set_message/operator `>` -> `==`