def getUniqueFilename(dir=None, base=None):
while True:<EOL><INDENT>fn = str(random.randint(<NUM_LIT:0>, <NUM_LIT>)) + "<STR_LIT>"<EOL>if not os.path.exists(fn):<EOL><INDENT>break<EOL><DEDENT><DEDENT>return fn<EOL>
DESCRP: Generate a filename in the directory <dir> which is
        unique (i.e. not in use at the moment)
PARAMS: dir  -- the directory to look in. If None, use CWD
        base -- use this as the base name for the filename
RETURN: string -- the filename generated