@check_for(Definition)<EOL><INDENT>def check_docstring_sections(self, definition, docstring):<DEDENT>
if not docstring:<EOL><INDENT>return<EOL><DEDENT>lines = docstring.split("<STR_LIT:\n>")<EOL>if len(lines) < <NUM_LIT:2>:<EOL><INDENT>return<EOL><DEDENT>lower_section_names = [s.lower() for s in self.SECTION_NAMES]<EOL>def _suspected_as_section(_line):<EOL><INDENT>result = self._get_leading_words(_line.lower())<EOL>return result in lower_section_names<EOL><DEDENT>suspected_section_indices = [i for i, line in enumerate(lines) if<EOL>_suspected_as_section(line)]<EOL>SectionContext = namedtuple('<STR_LIT>', ('<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>'))<EOL>contexts = (SectionContext(self._get_leading_words(lines[i].strip()),<EOL>lines[i - <NUM_LIT:1>],<EOL>lines[i],<EOL>lines[i + <NUM_LIT:1>:],<EOL>i,<EOL>False)<EOL>for i in suspected_section_indices)<EOL>contexts = (c for c in contexts if self._is_a_docstring_section(c))<EOL>for a, b in pairwise(contexts, None):<EOL><INDENT>end = -<NUM_LIT:1> if b is None else b.original_index<EOL>new_ctx = SectionContext(a.section_name,<EOL>a.previous_line,<EOL>a.line,<EOL>lines[a.original_index + <NUM_LIT:1>:end],<EOL>a.original_index,<EOL>b is None)<EOL>for err in self._check_section(docstring, definition, new_ctx):<EOL><INDENT>yield err<EOL><DEDENT><DEDENT>
D21{4,5}, D4{05,06,07,08,09,10}: Docstring sections checks.

        Check the general format of a sectioned docstring:
            '''This is my one-liner.

            Short Summary
            -------------
            This is my summary.

            Returns
            -------
            None.

            '''

        Section names appear in `SECTION_NAMES`.