<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_docstring(entity):
 """ Return sanitized docstring from an entity. The first line of the docstring is the title, and remaining lines are the details, aka git style. """

    doc = inspect.getdoc(entity)
    if not doc:
        return None, None
    doc = doc.splitlines(keepends=True)
    if not doc[0].strip():
        doc.pop(0)
    title = (doc and doc.pop(0).strip()) or None
    if doc and not doc[0].strip():
        doc.pop(0)
    desc = ''.join(doc).rstrip() or None
    return title, desc