code: def test_functional_list_outputs_nested_list_losses(self):
      model = _get_model_multi_outputs_list()
      self.assertIsInstance(model, Functional)
      x = np.random.rand(8, 3)
      y1 = np.random.rand(8, 1)
      y2 = np.random.randint(0, 2, (8, 1))
      model.compile(
          optimizer="sgd",
          loss=["mean_squared_error", ["binary_crossentropy"]],
          metrics=[
              "mean_squared_error",
              ["mean_squared_error", "accuracy"],
          ],
          loss_weights=[0.1, 2],
      )
      # Fit the model to make sure compile_metrics are built
      hist = model.fit(x, (y1, y2), batch_size=2, epochs=1, verbose=0)
      hist_keys = sorted(hist.history.keys())
      # TODO `tf.keras` also outputs individual losses for outputs
      ref_keys = sorted(
          [
              "loss",
              # "output_a_loss",
              "output_a_mean_squared_error",
              "output_b_accuracy",
              # "output_b_loss",
              "output_b_mean_squared_error",
          ]
      )
      self.assertListEqual(hist_keys, ref_keys)
  
imports: import numpy
  import pytest
  from absl.testing import parameterized
  from keras import layers
  from keras import testing
  from keras.layers.core.input_layer import Input
  from keras.models.functional import Functional
  from keras.models.model import Model
  from keras.models.model import model_from_json
label_desc: Use image node_id 8 for calling the ModelTest obj's underlying member method code with example usage: obj.test_functional_list_outputs_nested_list_losses() without return types