def mut_pair_num(table):
    """
    A function that calculates the number of pairs of codons one
    mutation away from each other. Treats mutations with directionality. In
    general, the number of mutational pairs is equal to the number of
    codons in a table multiplied by the number of unique codons within one
    mutation. Let a = alphabet length (generally 4), L = codon length
    (generally 3)

            n = (a^L) * L(a-1)

    Parameters
    ----------
        dict table: the codon table to analyze

    Returns
    -------
        int mut_num: the number of distinct mutational pairs.
    """
    # get list of all codons in table
    codon_list = list(table)
    # get alphabet size
    alphabet = set()
    for codon in codon_list:
        for nt in codon:
            alphabet.add(nt)
    a = len(alphabet)
    # get codon length
    L = len(codon_list[0])
    # calculate mut_num and return
    return (a ** L) * L * (a - 1)