human
Complete this python program:
def _count_diff_NG86(codon1, codon2, codon_table=default_codon_table):
assistant
#Here is the Python program you requested.

    """Count differences between two codons (three-letter string; PRIVATE).
    The function will take multiple pathways from codon1 to codon2
    into account.
    """
    if ((not isinstance(codon1, str)) or (not isinstance(codon2, str))):
        raise TypeError('_count_diff_NG86    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)))
    SN = [0, 0]
    if ((codon1 == '---') or (codon2 == '---')):
        return SN
    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 SN
    else:
        diff_pos = []
        for (i, k) in enumerate(zip(codon1, codon2)):
            if (k[0] != k[1]):
                diff_pos.append(i)
        def compare_codon(codon1, codon2, codon_table=default_codon_table, weight=1):
            'Compare    two    codon    accounting    for    different    pathways.'
            sd = nd = 0
            if (len(set(map(codon_table.forward_table.get, [codon1, codon2]))) == 1):
                sd += weight
            else:
                nd += weight
            return (sd, nd)
        if (len(diff_pos) == 1):
            SN = [(i + j) for (i, j) in zip(SN, compare_codon(codon1, codon2, codon_table=codon_table))]
        elif (len(diff_pos) == 2):
            codon2_aa = codon_table.forward_table[codon2]
            for i in diff_pos:
                temp_codon = ((codon1[:i] + codon2[i]) + codon1[(i + 1):])
                SN = [(i + j) for (i, j) in zip(SN, compare_codon(codon1, temp_codon, codon_table=codon_table, weight=0.5))]
         ...