def apply_threshold(pred_prob_labels, threshold):
    """Sends every prediction in the list below the threshold
    (exclusive) to zero and everything above it (inclusive) to one.
    In the parlance of this file, turns predicted probablistic labels
    into predicted labels. Returns a list."""

    return list(map(lambda pred: 1 if pred >= threshold else 0,
        pred_prob_labels))