human
I wrote the below code

    if ((conditional is not None) and (start_response is None)):
        raise TypeError('If    you    provide    conditional    you    must    also    provide    start_response')
    data = []
    output = StringIO()
    def replacement_start_response(status, headers, exc_info=None):
        if ((conditional is not None) and (not conditional(status, headers))):
            data.append(None)
            return start_response(status, headers, exc_info)
        if data:
            data[:] = []
        data.append(status)
        data.append(headers)
        return output.write
    app_iter = application(environ, replacement_start_response)
    if (data[0] is None):
        return (None, None, app_iter)
    try:
        for item in app_iter:
            output.write(item)
    finally:
        if hasattr(app_iter, 'close'):
            app_iter.close()
    if (not data):
        data.append(None)
    if (len(data) < 2):
        data.append(None)
    data.append(output.getvalue())
    return data

What's a good function header?
 Here's a good function header?
assistant
#Here's a good function header.

def intercept_output(environ, application, conditional=None, start_response=None):