import textwrap


def _wrap_docstring(doc):
    """Helper function to wrap a docstring at 72 characters while
    maintaining line breaks.

    """
    return "\n".join(
        ["\n".join(textwrap.wrap(l, subsequent_indent="    "))
         for l in doc.split('\n') if l])