def get_threshold_job(get_mock_stats_dir: Path) -> callable:
        """Return a function that takes prediction data and runs threshold job."""
        thresh_job_generator = ThresholdingJobGenerator(
            root_dir=get_mock_stats_dir,
            normalization_stage=NormalizationStage.IMAGE,
        )

        def thresh_helper(preds: dict) -> list | None:
            thresh_job = next(thresh_job_generator.generate_jobs(prev_stage_result=preds))
            return thresh_job.run()

        return thresh_helper
Return a function that takes prediction data and runs threshold job.
tests/unit/pipelines/tiled_ensemble/test_components.py