def module_files(module, dependencies_dict=None):
if dependencies_dict is None:<EOL><INDENT>dependencies_dict = dict()<EOL><DEDENT>if hasattr(module, '<STR_LIT>'):<EOL><INDENT>filename = module.__file__<EOL>if filename not in dependencies_dict:<EOL><INDENT>realname, modified_time = _get_filename_and_modified(filename)<EOL>if realname and realname not in dependencies_dict:<EOL><INDENT>dependencies_dict[realname] = modified_time<EOL>for name in dir(module):<EOL><INDENT>try:<EOL><INDENT>item = getattr(module, name)<EOL>if hasattr(item, '<STR_LIT>'):<EOL><INDENT>module_files(item, dependencies_dict)<EOL><DEDENT>elif hasattr(item, '<STR_LIT>'):<EOL><INDENT>item = sys.modules[getattr(item, '<STR_LIT>')]<EOL>if hasattr(item, '<STR_LIT>'):<EOL><INDENT>module_files(item, dependencies_dict)<EOL><DEDENT><DEDENT><DEDENT>except (AttributeError, KeyError):<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>return dependencies_dict<EOL>
Scan a module and its entire dependency tree to create a dict of all files
and their modified time.

@param module: A <module> object
@param dependencies_dict: Pass an existing dict to add only unscanned
    files or None to create a new file dict
@return: A dict containing filenames as keys with their modified time
    as value