human
Here's a good function header given the following:
I wrote the below code

    both = (which == 'both')
    stdout = ((which == 'stdout') or both)
    stderr = ((which == 'stderr') or both)
    def mocked_streams_decorator(func):
        @wraps(func)
        def inner_wrapper(*args, **kwargs):
            if both:
                sys.stdall = StringIO()
                fake_stdout = CarbonCopy(cc=sys.stdall)
                fake_stderr = CarbonCopy(cc=sys.stdall)
            else:
                (fake_stdout, fake_stderr) = (StringIO(), StringIO())
            if stdout:
                (my_stdout, sys.stdout) = (sys.stdout, fake_stdout)
            if stderr:
                (my_stderr, sys.stderr) = (sys.stderr, fake_stderr)
            try:
                func(*args, **kwargs)
            finally:
                if stdout:
                    sys.stdout = my_stdout
                if stderr:
                    sys.stderr = my_stderr
                if both:
                    del sys.stdall
        return inner_wrapper
    return mocked_streams_decorator

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

def mock_streams(which):