human
Complete this python program:
def fill(text, width, *args, **kwargs):
assistant
#Here is the Python code you requested.

    """Like :func:`textwrap.wrap` but preserves existing paragraphs which
    :func:`textwrap.wrap` does not otherwise handle well.  Also handles section
    headers.
    """
    paragraphs = text.split('\n\n')
    def maybe_fill(t):
        if all(((len(l) < width) for l in t.splitlines())):
            return t
        else:
            return textwrap.fill(t, width, *args, **kwargs)
    return '\n\n'.join((maybe_fill(p) for p in paragraphs))