def METHOD_NAME(tmpdir):
    tsk, target = get_sample_task()
    best = str(tsk.config_space.get(2))
    inputs_batch_1 = [MeasureInput(target, tsk, tsk.config_space.get(i)) for i in range(2)]
    results_batch_1 = [MeasureResult((i,), 0, 0, 0) for i in range(1, 3)]
    filepath_batch_1 = tmpdir / "batch_1.log"
    with open(filepath_batch_1, "w") as file:
        autotvm.callback.log_to_file(file)(None, inputs_batch_1, results_batch_1)
    inputs_batch_2 = [MeasureInput(target, tsk, tsk.config_space.get(i)) for i in range(2, 4)]
    results_batch_2 = [MeasureResult((0.5,), 0, 0, 0), MeasureResult((3,), 0, 0, 0)]
    filepath_batch_2 = tmpdir / "batch_2.log"
    with open(filepath_batch_2, "w") as file:
        autotvm.callback.log_to_file(file)(None, inputs_batch_2, results_batch_2)
    # Check two Path filepaths works
    hist_best = ApplyHistoryBest([filepath_batch_1, filepath_batch_2])
    assert str(hist_best.query(target, tsk.workload)) == best
    # Check that an arbitrary Iterable of Paths works
    # Calling zip() on a single list gives a non-subscriptable Iterable
    hist_best = ApplyHistoryBest(zip([filepath_batch_1, filepath_batch_2]))
    assert str(hist_best.query(target, tsk.workload)) == best
    # Check that Iterable of Iterable of tuples is correctly merged
    hist_best = ApplyHistoryBest(
        zip(
            [
                zip(inputs_batch_1, results_batch_1),
                zip(inputs_batch_2, results_batch_2),
            ]
        )
    )
    assert str(hist_best.query(target, tsk.workload)) == best