def file2module(filename):
basename = osp.basename(filename)<EOL>if '<STR_LIT:.>' in basename:<EOL><INDENT>pos = basename.rfind('<STR_LIT:.>')<EOL>return basename[:pos]<EOL><DEDENT>else:<EOL><INDENT>return basename<EOL><DEDENT>return None<EOL>
Given a file name, extract the most likely module name.