def METHOD_NAME(
    baseline_images, tol,
):
    """
    Decorate function with image comparison for unittest.
    This function creates a decorator that wraps a figure-generating function
    with image comparison code.
    """
    def decorator(func):
        old_sig = inspect.signature(func)
        # This saves us to lift name, docstring, etc.
        # NOTE: not super sure why we need this additional layer of wrapping
        # seems to have to do with stripping arguments from the test function
        # probably redundant in this adaptation
        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            # This decorator is applied to unittest methods
            self = args[0]
            # Three steps:
            # 1. run the function
            func(*args, **kwargs)
            # 2. locate the control and result images
            baselines = _load_baseline_images(baseline_images)
            figs = _load_result_images(baseline_images)
            # 3. compare them one by one
            for i, (baseline, fig) in enumerate(zip(baselines, figs)):
                res = compare_image(baseline, fig, tol)
                self.assertLessEqual(res, tol)
        parameters = list(old_sig.parameters.values())
        new_sig = old_sig.replace(parameters=parameters)
        wrapper.__signature__ = new_sig
        return wrapper
    return decorator