human
Complete this python program:
def cut_lines(pre, post=0, what=None):
assistant
#Here=None):
.

    """Return a listener that removes the first *pre* and last *post*
    lines of every docstring.  If *what* is a sequence of strings,
    only docstrings of a type in *what* will be processed.
    Use like this (e.g. in the ``setup()`` function of :file:`conf.py`)::
    from sphinx.ext.autodoc import cut_lines
    app.connect(\autodoc-process-docstring\, cut_lines(4, what=[\module\]))
    This can (and should) be used in place of :confval:`automodule_skip_lines`.
    """
    def process(app, what_, name, obj, options, lines):
        if (what and (what_ not in what)):
            return
        del lines[:pre]
        if post:
            if (lines and (not lines[(-1)])):
                lines.pop((-1))
            del lines[(- post):]
        if (lines and lines[(-1)]):
            lines.append('')
    return process