human
Complete the below
def capture_stderr(f):

    ''''Decorator to capture stderr in a buffer so that it can be checked
    (or suppressed) during testing.
    Parameters
    f : callable
    The test that is capturing stderr.
    Returns
    f : callable
    The decorated test ``f``, which captures stderr.
    Examples
    >>> from pandas.util.testing import capture_stderr
    >>> import sys
    >>> @capture_stderr
    ... def test_stderr_pass():
    ...     sys.stderr.write("foo")
    ...     out = sys.stderr.getvalue()
    ...     assert out == "foo
    >>> @capture_stderr
    ... def test_stderr_fail():
    ...     sys.stderr.write("foo")
    ...     out = sys.stderr.getvalue()
    ...     assert out == "bar
    AssertionError: assert \'foo
    \' == \'bar'
    '''

Can you provide a the Python program you requested?
assistant
#Here is the Python program you requested.
    @wraps(f)
    def wrapper(*args, **kwargs):
        try:
            sys.stderr = StringIO()
            f(*args, **kwargs)
        finally:
            sys.stderr = sys.__stderr__
    return wrapper