def find_temp_dir(prefix, tmp_dir=None):
matches = []<EOL>tmp_dir = tmp_dir or tempfile.gettempdir()<EOL>for tmp_file in os.listdir(tmp_dir):<EOL><INDENT>if tmp_file.startswith(prefix):<EOL><INDENT>matches.append(os.path.join(tmp_dir, tmp_file))<EOL><DEDENT><DEDENT>return matches<EOL>
Find temp dirs in 'tmp_dir' starting with 'prefix