@check_for(Definition, terminal=True)<EOL><INDENT>def check_docstring_missing(self, definition, docstring):<DEDENT>
if (not docstring and definition.is_public or<EOL>docstring and is_blank(ast.literal_eval(docstring))):<EOL><INDENT>codes = {Module: violations.D100,<EOL>Class: violations.D101,<EOL>NestedClass: violations.D106,<EOL>Method: (lambda: violations.D105() if definition.is_magic<EOL>else (violations.D107() if definition.is_init<EOL>else violations.D102())),<EOL>Function: violations.D103,<EOL>NestedFunction: violations.D103,<EOL>Package: violations.D104}<EOL>return codes[type(definition)]()<EOL><DEDENT>
D10{0,1,2,3}: Public definitions should have docstrings.

        All modules should normally have docstrings.  [...] all functions and
        classes exported by a module should also have docstrings. Public
        methods (including the __init__ constructor) should also have
        docstrings.

        Note: Public (exported) definitions are either those with names listed
              in __all__ variable (if present), or those that do not start
              with a single underscore.