To do so I search for the line inside a docstring that starts with either "def " or "class " and has indentation less than that of opening docstring quotes.