def _restore_case(s, memory):
cased_s = []<EOL>for i, c in enumerate(s):<EOL><INDENT>if i + <NUM_LIT:1> > len(memory):<EOL><INDENT>break<EOL><DEDENT>cased_s.append(c if memory[i] else c.upper())<EOL><DEDENT>return '<STR_LIT>'.join(cased_s)<EOL>
Restore a lowercase string's characters to their original case.