code: def test_loss_with_targets(
      builder: EnsembleBuilder,
      make_run: Callable[..., Run],
      kind: str,
  ) -> None:
      """
      Expects
      -------
      * Should give a loss < np.inf if the predictions exist
      """
      X_data = builder.X_data(kind)
      targets = builder.targets(kind)
      metric = builder.metrics[0]
  
      run = make_run(predictions={kind: targets})
  
      assert (
          builder.loss(run, metric=metric, X_data=X_data, kind=kind)
          < np.inf
      )
  
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 21 for calling a global function with example usage: test_loss_with_targets(builder, make_run, kind) without return types