def kendall_tau(worder, normalize=True):
    worder_len = len(worder)
    # Extract the groups of increasing/monotonic sequences.
    increasing_sequences = find_increasing_sequences(worder)
    # Calculate no. of increasing_pairs in *worder* list.
    num_increasing_pairs = sum(choose(len(seq),2) for seq in increasing_sequences) 
    # Calculate no. of possible pairs.
    num_possible_pairs = choose(worder_len, 2)
    # Kendall's Tau computation.
    tau = 2 * num_increasing_pairs / num_possible_pairs -1
    if normalize: # If normalized, the tau output falls between 0.0 to 1.0
        return (tau + 1) /2
    else: # Otherwise, the tau outputs falls between -1.0 to +1.0
        return tau
Calculates the Kendall's Tau correlation coefficient given the *worder*
dataset/ETHPy150Open nltk/nltk/nltk/translate/ribes_score.py/kendall_tau