code: def test_candidates_filters_runs_with_no_predictions(
      builder: EnsembleBuilder, make_run: Callable[..., Run]
  ) -> None:
      """
      Expects
      -------
      * Should have nothing in common between candidates and discarded
      * Should filter out runs with no "ensemble" predictions
      """
      metrics = builder.metrics
      dummy = make_run(dummy=True, losses={m.name: 2 for m in metrics})
  
      bad_runs = [make_run(predictions=None) for _ in range(5)]
  
      good_run = make_run(
          predictions="ensemble", losses={m.name: 1 for m in metrics}
      )
  
      runs = bad_runs + [good_run]
  
      candidates, discarded = builder.candidate_selection(runs, dummy)
  
      assert len(set(candidates) & discarded) == 0
      assert len(candidates) == 1
      assert len(discarded) == len(bad_runs)
      assert candidates[0].pred_path("ensemble").exists()
  
imports: from __future__ import annotations
  from typing import Callable
  import random
  import time
  from pathlib import Path
  import numpy
  from autosklearn.automl_common.common.utils.backend import Backend
  from autosklearn.ensemble_building import EnsembleBuilder, Run
  from autosklearn.metrics import Scorer, accuracy, make_scorer
  from autosklearn.util.functional import bound, pairs
  import pytest
  from pytest_cases import fixture, parametrize
  from unittest.mock import Mock, patch
  from test.conftest import DEFAULT_SEED
  from test.fixtures.metrics import acc_with_X_data
label_desc: Use image node_id 8 for calling a global function with example usage: test_candidates_filters_runs_with_no_predictions(builder, make_run) without return types