human
I wrote the below code

    if ((not isinstance(codon1, str)) or (not isinstance(codon2, str))):
        raise TypeError('_count_diff_YN00    accepts    string    object    to    represent    codon    ({0},    {1}    detected)'.format(type(codon1), type(codon2)))
    if ((len(codon1) != 3) or (len(codon2) != 3)):
        raise RuntimeError('codon    should    be    three    letter    string    ({0},    {1}    detected)'.format(len(codon1), len(codon2)))
    TV = [0, 0, 0, 0]
    site = 0
    if ((codon1 == '---') or (codon2 == '---')):
        return TV
    base_tuple = ('A', 'C', 'G', 'T')
    if (not all(((i in base_tuple) for i in codon1))):
        raise RuntimeError('Unrecognized    character    detected    in    codon1    {0}    (Codons    consist    of    A,    T,    C    or    G)'.format(codon1))
    if (not all(((i in base_tuple) for i in codon2))):
        raise RuntimeError('Unrecognized    character    detected    in    codon2    {0}    (Codons    consist    of    A,    T,    C    or    G)'.format(codon2))
    if (codon1 == codon2):
        return TV
    else:
        diff_pos = []
        for (i, k) in enumerate(zip(codon1, codon2)):
            if (k[0] != k[1]):
                diff_pos.append(i)
        def count_TV(codon1, codon2, diff, codon_table, weight=1):
            purine = ('A', 'G')
            pyrimidine = ('T', 'C')
            dic = codon_table.forward_table
            stop = codon_table.stop_codons
            if ((codon1 in stop) or (codon2 in stop)):
                if ((codon1[diff] in purine) and (codon2[diff] in purine)):
                    return [0, 0, weight, 0]
                elif ((codon1[diff] in pyrimidine) and (codon2[diff] in pyrimidine)):
                    return [0, 0, weight, 0]
                else:
                    return [0, 0, 0, weight]
            elif (dic[codon1] == dic[codon2]):
                if ((codon1[diff] in purine) and (codon2[diff] in purine)):
                    return [weight, 0, 0, 0]
                elif ((codon1[diff] in pyrimidine) and (codon2[diff] in...

What's a good function header?
 ... Here's a good function header?
assistant
#Here's a good function header.

def _count_diff_YN00(codon1, codon2, P, codon_lst, codon_table=default_codon_table):