def check_docstrings(show_diff=False, config=None, mods=None):
    """
    Check docstrings in module match the README.md
    """

    readme = parse_readme()
    modules_readme = core_module_docstrings(config=config)
    warned = False
    if create_readme(readme) != create_readme(modules_readme):
        for module in sorted(readme):
            if mods and module not in mods:
                continue
            err = None
            if module not in modules_readme:
                err = "Module {} in README but not in /modules".format(module)
            elif (
                "".join(readme[module]).strip()
                != "".join(modules_readme[module]).strip()
            ):
                err = "Module {} docstring does not match README".format(module)
            if err:
                if not warned:
                    print_stderr("Documentation does not match!\n")
                    warned = True
                print_stderr(err)

        for module in modules_readme:
            if mods and module not in mods:
                continue
            if module not in readme:
                print_stderr("Module {} in /modules but not in README".format(module))
        if show_diff:
            print_stderr(
                "\n".join(
                    difflib.unified_diff(
                        create_readme(readme).split("\n"),
                        create_readme(modules_readme).split("\n"),
                    )
                )
            )
        else:
            if warned:
                print_stderr("\nUse `py3-cmd docstring --diff` to view diff.")
Check docstrings in module match the README.md