def rep(data):
    """Checks if all labels are represented
    in the dataset `data`."""

    labels = [0, 1]

    # Iteratively check if all labels are represented
    for i in range(len(data) - 1):
        row = data[i]
        label = row["label"]
        contains = label in labels

        if contains and labels:
            # If label found, remove from list
            labels.pop(label)
        elif not labels:
            # List is empty, so all labels
            # are represented
            return True

    return False