code: def annotate_dataset_feature_statistics_plots(
      model_card: model_card_module.ModelCard,
      data_stats: Sequence[statistics_pb2.DatasetFeatureStatisticsList],
  ) -> None:
      """Annotates visualizations for every dataset and feature.
  
      This function adds a new Dataset object at model_card.model_parameters.data
      for every dataset in data_stats. For every feature, histograms are created
      and encoded as base64 text strings. They can be found in the Dataset.graphics
      field.
  
      Args:
        model_card: The model card object.
        data_stats: A list of DatasetFeatureStatisticsList related to the dataset.
      """
      colors = (
          graphics._COLOR_PALETTE["material_teal_700"],
          graphics._COLOR_PALETTE["material_indigo_400"],
      )
      for stats, color in zip(data_stats, colors):
          if not stats:
              continue
          for dataset in stats.datasets:
              graphs = []
              for feature in dataset.features:
                  graph = _extract_graph_data_from_dataset_feature_statistics(
                      feature, color
                  )
                  graph = graphics.draw_histogram(graph)
                  if graph is not None:
                      graphs.append(
                          model_card_module.Graphic(
                              name=graph.name, image=graph.base64str
                          )
                      )
              model_card.model_parameters.data.append(
                  model_card_module.Dataset(
                      name=dataset.name,
                      graphics=model_card_module.GraphicsCollection(
                          collection=graphs
                      ),
                  )
              )
  
file_path: model-card-toolkit/model_card_toolkit/utils/tf_graphics.py
imports: import logging
  from typing import Optional, Sequence, Union
  import tensorflow_model_analysis
  from tensorflow_metadata.proto.v0 import statistics_pb2
  from model_card_toolkit import model_card
  from model_card_toolkit.utils import graphics
label_desc: Use image node_id 1 for calling a global function with example usage: annotate_dataset_feature_statistics_plots(model_card, data_stats) without return types