def METHOD_NAME(tmp_path):
    from ctapipe.tools.train_energy_regressor import TrainEnergyRegressor
    out_file = tmp_path / "energy.pkl"
    tool = TrainEnergyRegressor()
    config = resource_file("train_energy_regressor.yaml")
    ret = run_tool(
        tool,
        argv=[
            "--input=dataset://gamma_diffuse_dl2_train_small.dl2.h5",
            f"--output={out_file}",
            f"--config={config}",
            "--CrossValidator.n_cross_validations=0",
            "--log-level=INFO",
            "--overwrite",
        ],
    )
    assert ret == 0
    return out_file