def backup_dir(dir, ext='<STR_LIT>'):<EOL>
n = <NUM_LIT:1><EOL>extension = ext<EOL>while os.path.exists(dir + extension):<EOL><INDENT>n += <NUM_LIT:1><EOL>extension = ext + str(n)<EOL><DEDENT>return dir + extension<EOL>
Figure out the name of a directory to back up the given dir to
    (adding .bak, .bak2, etc)