def run(self, task_id: int | None = None) -> list[Any] | None:
        """Run job that produces prediction labels from scores.

        Args:
            task_id: Not used in this case.

        Returns:
            list[Any]: List of thresholded predictions.
        """
        del task_id  # not needed here

        logger.info("Starting thresholding.")

        for data in tqdm(self.predictions, desc="Thresholding"):
            if hasattr(data, "pred_score") and data.pred_score is not None:
                data.pred_label = data.pred_score >= self.image_threshold
            if hasattr(data, "anomaly_map") and data.anomaly_map is not None:
                data.pred_mask = data.anomaly_map >= self.pixel_threshold

        return self.predictions
Run job that produces prediction labels from scores.

        Args:
            task_id: Not used in this case.

        Returns:
            list[Any]: List of thresholded predictions.
        
src/anomalib/pipelines/tiled_ensemble/components/thresholding.py