def evaluate(labels, predictions):
    """
    Given a list of actual labels and a list of predicted labels,
    return a tuple (sensitivity, specificity).

    Assume each label is either a 1 (positive) or 0 (negative).

    `sensitivity` should be a floating-point value from 0 to 1
    representing the "true positive rate": the proportion of
    actual positive labels that were accurately identified.

    `specificity` should be a floating-point value from 0 to 1
    representing the "true negative rate": the proportion of
    actual negative labels that were accurately identified.
    """
    positives = negatives = 0
    true_positives = true_negatives = 0

    for i in range(len(labels)):
        if labels[i]:
            if predictions[i]:
                true_positives += 1
            positives += 1
        if labels[i] == 0:
            if predictions[i] == 0:
                true_negatives += 1
            negatives += 1
    return true_positives / positives, true_negatives / negatives