def parse_codons(ref, start, end, strand):
codon = []<EOL>c = cycle([<NUM_LIT:1>, <NUM_LIT:2>, <NUM_LIT:3>])<EOL>ref = ref[start - <NUM_LIT:1>:end]<EOL>if strand == -<NUM_LIT:1>:<EOL><INDENT>ref = rc_stats(ref)<EOL><DEDENT>for pos in ref:<EOL><INDENT>n = next(c)<EOL>codon.append(pos)<EOL>if n == <NUM_LIT:3>:<EOL><INDENT>yield codon<EOL>codon = []<EOL><DEDENT><DEDENT>
parse codon nucleotide positions in range start -> end, wrt strand