def message_has_label(message, label):
    """Tests whether a message has a label
    Args: message: message to consider.
          label: label to check.
    Returns: True/False.
    """

    return label['id'] in message.get('labelIds', [])