def index(search_path, ext=None):
if ext is None:<EOL><INDENT>ext = "<STR_LIT>"<EOL><DEDENT>fnames = set([])<EOL>for _, _, files in os.walk(search_path):<EOL><INDENT>for fname in files:<EOL><INDENT>if os.path.splitext(fname)[-<NUM_LIT:1>] in EXTS[ext]:<EOL><INDENT>fnames.add(fname)<EOL><DEDENT><DEDENT><DEDENT>return fnames<EOL>
@returns a set of filenames with extension 'ext' in 'search_path