def _count_replacement(codon_set, G):
 from math import floor
 if (len(codon_set) == 1):
  return (0, 0)
 elif (len(codon_set) == 2):
  codons = list(codon_set)
  return floor(G[codons[0]][codons[1]])
 else:
  codons = list(codon_set)
  return _prim(G)

def _count_replacement ( codon_set , G ) : from math import floor if ( len ( codon_set ) == 1 ) : return ( 0 , 0 ) elif ( len ( codon_set ) == 2 ) : codons = list ( codon_set ) return floor ( G [ codons [ 0 ] ] [ codons [ 1 ] ] ) else : codons = list ( codon_set ) return _prim ( G )
count replacement needed for a given codon_set .