def get_cutoff(labels,
               scores):

    """
    -- DESCRIPTION --
    Function to determine the optimal cutoff value (in terms of accuracy) for
    discriminating between active and inactive complexes. A score below the
    cutoff value denotes an inactive complex, a score equal or greater than the
    cutoff value denotes an active complex.
      PARAMS:
        - labels (list of strings): list of labels ("active" or "inactive")
        - scores (list of int): list of scores
            NOTE: labels[i] has to corresponds to scores[i]
      RETURNS:
        - list of optimal cutoff value (index 0, int) and corresponding
          prediction accuracy (index 1, float)
    """

    best_cutoff = 0
    best_accuracy = 0

    for i in range(min(scores), max(scores) + 1, 1):
        predicted = ["active" if score >= i else "inactive" for score in scores]
        agreement = 0
        for j, label in enumerate(labels):
            if label == predicted[j]:
                agreement = agreement + 1
        accuracy = agreement / len(labels)
        if accuracy >= best_accuracy:
            best_accuracy = accuracy
            best_cutoff = i

    return [best_cutoff, best_accuracy]