Parse a docstring into a semmary (first line) and notes (rest of it).

def parse_docstring(whatever_has_docstring):
    '''Parse a docstring into a semmary (first line) and notes (rest of it).'''
    try:
        summary, notes = whatever_has_docstring.__doc__.split('\n', 1)
        notes = dedent(notes).replace('\n', ' ')
    except ValueError:
        summary = whatever_has_docstring.__doc__.strip()
        notes = ''
    return summary, notes