human
I wrote the below code

    caught_warnings = []
    original_showwarning = warnings.showwarning
    def custom_showwarning(*args, **kwargs):
        caught_warnings.append(args[0])
    warnings.showwarning = custom_showwarning
    def restore_showwarning():
        warnings.showwarning = original_showwarning
    return (caught_warnings, restore_showwarning)

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

def setup_warning_catcher():