def METHOD_NAME(test_func):
    """Augment test function to parse log files.
    `tools.create_tests` creates functions that run an LBANN
    experiment. This function creates augmented functions that parse
    the log files after LBANN finishes running, e.g. to check metrics
    or runtimes.
    Note: The naive approach is to define the augmented test functions
    in a loop. However, Python closures are late binding. In other
    words, the function would be overwritten every time we define it.
    We get around this overwriting problem by defining the augmented
    function in the local scope of another function.
    Args:
        test_func (function): Test function created by
            `tools.create_tests`.
    Returns:
        function: Test that can interact with PyTest.
    """
    test_name = test_func.__name__
    # Define test function
    def func(cluster, dirname, weekly):
        if weekly:
            targets = weekly_options_and_targets
        else:
            targets = nightly_options_and_targets
        # Run LBANN experiment
        experiment_output = test_func(cluster, dirname, weekly)
        # Parse LBANN log file
        test_loss = None
        mini_batch_time = None
        with open(experiment_output["stdout_log_file"]) as f:
            for line in f:
                match = re.search("test loss : ([0-9.]+)", line)
                if match:
                    test_loss = float(match.group(1))
                match = re.search(
                    "test mini-batch time statistics : ([0-9.]+)s mean", line
                )
                if match:
                    mini_batch_time = float(match.group(1))
        # Check if testing accuracy is within expected range
        assert ((test_loss > targets['expected_test_loss_range'][0]
                 and test_loss < targets['expected_test_loss_range'][1])), \
                f"test loss {test_loss:.3f} is outside expected range " + \
                f"[{targets['expected_test_loss_range'][0]:.3f},{targets['expected_test_loss_range'][1]:.3f}]"
        # Check if mini-batch time is within expected range
        # Note: Skip first epoch since its runtime is usually an outlier
        min_expected_mini_batch_time = 0.75 * targets['expected_mini_batch_times'][cluster]
        max_expected_mini_batch_time = 1.25 * targets['expected_mini_batch_times'][cluster]
        if (mini_batch_time < min_expected_mini_batch_time or
            mini_batch_time > max_expected_mini_batch_time):
            warnings.warn(f'average mini-batch time {mini_batch_time:.3f} is outside expected range ' +
                          f'[{min_expected_mini_batch_time:.3f}, {max_expected_mini_batch_time:.3f}]', UserWarning)
    # Return test function from factory function
    func.__name__ = test_name
    return func