def parse_masked(seq, min_len):
nm, masked = [[]], [[]]<EOL>prev = None<EOL>for base in seq[<NUM_LIT:1>]:<EOL><INDENT>if base.isupper():<EOL><INDENT>nm[-<NUM_LIT:1>].append(base)<EOL>if masked != [[]] and len(masked[-<NUM_LIT:1>]) < min_len:<EOL><INDENT>nm.extend(masked[-<NUM_LIT:1>])<EOL>del masked[-<NUM_LIT:1>]<EOL><DEDENT>prev = False<EOL><DEDENT>elif base.islower():<EOL><INDENT>if prev is False:<EOL><INDENT>masked.append([])<EOL>nm.append([])<EOL><DEDENT>masked[-<NUM_LIT:1>].append(base)<EOL>prev = True<EOL><DEDENT><DEDENT>return nm, masked<EOL>
parse masked sequence into non-masked and masked regions