code: def test_annotate_eval_results_plots(self):
      slicing_metrics = [
          (
              (("weekday", 0),),
              {
                  "": {
                      "": {
                          "average_loss": {
                              "doubleValue": 0.07875693589448929
                          },
                          "prediction/mean": {
                              "boundedValue": {
                                  "value": 0.5100112557411194,
                                  "lowerBound": 0.4100112557411194,
                                  "upperBound": 0.6100112557411194,
                              }
                          },
                          "average_loss_diff": {},
                      }
                  }
              },
          ),
          (
              (("weekday", 1),),
              {
                  "": {
                      "": {
                          "average_loss": {
                              "doubleValue": 4.4887189865112305
                          },
                          "prediction/mean": {
                              "boundedValue": {
                                  "value": 0.4839990735054016,
                                  "lowerBound": 0.3839990735054016,
                                  "upperBound": 0.5839990735054016,
                              }
                          },
                          "average_loss_diff": {},
                      }
                  }
              },
          ),
          (
              (("weekday", 2),),
              {
                  "": {
                      "": {
                          "average_loss": {
                              "doubleValue": 2.092138290405273
                          },
                          "prediction/mean": {
                              "boundedValue": {
                                  "value": 0.3767518997192383,
                                  "lowerBound": 0.1767518997192383,
                                  "upperBound": 0.5767518997192383,
                              }
                          },
                          "average_loss_diff": {},
                      }
                  }
              },
          ),
          (
              (("gender", "male"), ("age", 10)),
              {
                  "": {
                      "": {
                          "average_loss": {
                              "doubleValue": 2.092138290405273
                          },
                          "prediction/mean": {
                              "boundedValue": {
                                  "value": 0.3767518997192383,
                                  "lowerBound": 0.1767518997192383,
                                  "upperBound": 0.5767518997192383,
                              }
                          },
                          "average_loss_diff": {},
                      }
                  }
              },
          ),
          (
              (("gender", "female"), ("age", 20)),
              {
                  "": {
                      "": {
                          "average_loss": {
                              "doubleValue": 2.092138290405273
                          },
                          "prediction/mean": {
                              "doubleValue": 0.3767518997192383
                          },
                          "average_loss_diff": {},
                          "__ERROR__": {
                              # CI not computed because only 16 samples
                              # were non-empty. Expected 20.
                              "bytesValue": "Q0kgbm90IGNvbXB1dGVkIGJlY2F1c2Ugb25seSAxNiBzYW1wbGVzIHdlcmUgbm9uLWVtcHR5LiBFeHBlY3RlZCAyMC4="  # pylint: disable=line-too-long
                          },
                      }
                  }
              },
          ),
          (
              (),
              {
                  "": {
                      "": {
                          "average_loss": {
                              "doubleValue": 1.092138290405273
                          },
                          "prediction/mean": {
                              "boundedValue": {
                                  "value": 0.4767518997192383,
                                  "lowerBound": 0.2767518997192383,
                                  "upperBound": 0.6767518997192383,
                              }
                          },
                          "average_loss_diff": {},
                      }
                  }
              },
          ),
      ]
      eval_result = tfma.EvalResult(
          slicing_metrics=slicing_metrics,
          plots=None,
          attributions=None,
          config=None,
          data_location=None,
          file_format=None,
          model_location=None,
      )
      model_card = model_card_module.ModelCard()
      tf_graphics.annotate_eval_result_plots(model_card, eval_result)
  
      expected_metrics_names = {
          "average_loss | weekday",
          "prediction/mean | weekday",
          "average_loss | gender, age",
          "prediction/mean | gender, age",
      }
      self.assertSameElements(
          expected_metrics_names,
          [
              g.name
              for g in model_card.quantitative_analysis.graphics.collection
          ],
      )
  
      for graph in model_card.quantitative_analysis.graphics.collection:
          logging.info("%s: %s", graph.name, graph.image)
          self.assertNotEmpty(
              graph.image, f"feature {graph.name} has empty plot"
          )
  
file_path: model-card-toolkit/model_card_toolkit/utils/tf_graphics_test.py
imports: import logging
  import tensorflow_model_analysis
  from absl.testing import absltest
  from google.protobuf import text_format
  from tensorflow_metadata.proto.v0 import statistics_pb2
  from model_card_toolkit import model_card
  from model_card_toolkit.utils import graphics, tf_graphics
label_desc: Use image node_id 5 for calling the TfGraphicsTest obj's underlying member method code with example usage: obj.test_annotate_eval_results_plots() without return types