def has_urn_and_labels(mi, urn, labels):
    """Returns true if it the monitoring_info contains the labels and urn."""

    def contains_labels(mi, labels):
        # Check all the labels and their values exist in the monitoring_info
        return all(item in mi.labels.items() for item in labels.items())

    return contains_labels(mi, labels) and mi.urn == urn