def filesByExtension(fnames):
byExt={"<STR_LIT>":[],"<STR_LIT>":[],"<STR_LIT>":[]} <EOL>for fname in fnames:<EOL><INDENT>ext = os.path.splitext(fname)[<NUM_LIT:1>].replace("<STR_LIT:.>",'<STR_LIT>').lower()<EOL>if not ext in byExt.keys():<EOL><INDENT>byExt[ext]=[]<EOL><DEDENT>byExt[ext]=byExt[ext]+[fname]<EOL><DEDENT>return byExt<EOL>
given a list of files, return a dict organized by extension.