def _align(x, y, local = False):
if local:<EOL><INDENT>aligned_x = pairwise2.align.localxx(x, y)<EOL><DEDENT>else:<EOL><INDENT>aligned_x =  pairwise2.align.globalms(x, y, <NUM_LIT:1>, -<NUM_LIT:1>, -<NUM_LIT:1>, -<NUM_LIT:0.5>)<EOL><DEDENT>if aligned_x:<EOL><INDENT>sorted_alignments = sorted(aligned_x, key=operator.itemgetter(<NUM_LIT:2>))<EOL>e = enumerate(sorted_alignments[<NUM_LIT:0>][<NUM_LIT:0>])<EOL>nts = [i for i,c in e if c != "<STR_LIT:->"]<EOL>return [min(nts), max(nts)]<EOL><DEDENT>
https://medium.com/towards-data-science/pairwise-sequence-alignment-using-biopython-d1a9d0ba861f