def relative_script(lines):
activate = "<STR_LIT>"<EOL>activate_at = None<EOL>for idx, line in reversed(list(enumerate(lines))):<EOL><INDENT>if line.split()[:<NUM_LIT:3>] == ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>activate_at = idx + <NUM_LIT:1><EOL>break<EOL><DEDENT><DEDENT>if activate_at is None:<EOL><INDENT>activate_at = <NUM_LIT:1><EOL><DEDENT>return lines[:activate_at] + ['<STR_LIT>', activate, '<STR_LIT>'] + lines[activate_at:]<EOL>
Return a script that'll work in a relocatable environment.