def _get_module_name_from_fname(fname):
fname = fname.replace("<STR_LIT>", "<STR_LIT>")<EOL>for mobj in sys.modules.values():<EOL><INDENT>if (<EOL>hasattr(mobj, "<STR_LIT>")<EOL>and mobj.__file__<EOL>and (mobj.__file__.replace("<STR_LIT>", "<STR_LIT>") == fname)<EOL>):<EOL><INDENT>module_name = mobj.__name__<EOL>return module_name<EOL><DEDENT><DEDENT>raise RuntimeError("<STR_LIT>")<EOL>
Get module name from module file name.