def check_docstrings(show_diff=False, config=None, mods=None):
readme = parse_readme()<EOL>modules_readme = core_module_docstrings(config=config)<EOL>warned = False<EOL>if create_readme(readme) != create_readme(modules_readme):<EOL><INDENT>for module in sorted(readme):<EOL><INDENT>if mods and module not in mods:<EOL><INDENT>continue<EOL><DEDENT>err = None<EOL>if module not in modules_readme:<EOL><INDENT>err = "<STR_LIT>".format(module)<EOL><DEDENT>elif (<EOL>"<STR_LIT>".join(readme[module]).strip()<EOL>!= "<STR_LIT>".join(modules_readme[module]).strip()<EOL>):<EOL><INDENT>err = "<STR_LIT>".format(module)<EOL><DEDENT>if err:<EOL><INDENT>if not warned:<EOL><INDENT>print_stderr("<STR_LIT>")<EOL>warned = True<EOL><DEDENT>print_stderr(err)<EOL><DEDENT><DEDENT>for module in modules_readme:<EOL><INDENT>if mods and module not in mods:<EOL><INDENT>continue<EOL><DEDENT>if module not in readme:<EOL><INDENT>print_stderr("<STR_LIT>".format(module))<EOL><DEDENT><DEDENT>if show_diff:<EOL><INDENT>print_stderr(<EOL>"<STR_LIT:\n>".join(<EOL>difflib.unified_diff(<EOL>create_readme(readme).split("<STR_LIT:\n>"),<EOL>create_readme(modules_readme).split("<STR_LIT:\n>"),<EOL>)<EOL>)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>if warned:<EOL><INDENT>print_stderr("<STR_LIT>")<EOL><DEDENT><DEDENT><DEDENT>
Check docstrings in module match the README.md