code: def _create_anomalies_alerts(
      anomalies: anomalies_pb2.Anomalies,
      split: str,
  ) -> list[component_generated_alert_pb2.ComponentGeneratedAlertInfo]:
      """Creates an alert for each anomaly in the anomalies artifact."""
      result = []
      # Information about data missing in the dataset.
      if anomalies.HasField("data_missing"):
          result.append(
              component_generated_alert_pb2.ComponentGeneratedAlertInfo(
                  alert_name=f"Data missing in split {split}",
                  alert_body=f"Empty input data for {split}.",
              )
          )
      # Information about dataset-level anomalies, such as "Low num examples
      # in dataset."
      if anomalies.HasField("dataset_anomaly_info"):
          result.append(
              component_generated_alert_pb2.ComponentGeneratedAlertInfo(
                  alert_name="Dataset anomalies",
                  alert_body=(
                      f"{anomalies.dataset_anomaly_info.description} in split "
                      f"{split}"
                  ),
              )
          )
      # Information about feature-level anomalies, such as "Some examples have
      # fewer values than expected."
      for feature_name, anomaly_info in anomalies.anomaly_info.items():
          result.append(
              component_generated_alert_pb2.ComponentGeneratedAlertInfo(
                  alert_name=anomaly_info.short_description,
                  alert_body=(
                      f"{anomaly_info.description} for feature {feature_name} in "
                      f"split {split}."
                  ),
              )
          )
      return result
  
imports: import os
  from typing import Any, Dict, List
  from absl import logging
  import tensorflow_data_validation
  from tfx import types
  from tfx.components.example_validator import labels
  from tfx.components.statistics_gen import stats_artifact_utils
  from tfx.components.util import value_utils
  from tfx.dsl.components.base import base_executor
  from tfx.orchestration.experimental.core import component_generated_alert_pb2
  from tfx.orchestration.experimental.core import constants
  from tfx.proto.orchestration import execution_result_pb2
  from tfx.types import artifact_utils
  from tfx.types import standard_component_specs
  from tfx.utils import io_utils
  from tfx.utils import json_utils
  from tfx.utils import writer_utils
  from google.protobuf import any_pb2
  from tensorflow_metadata.proto.v0 import anomalies_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: _create_anomalies_alerts(anomalies, split) and returns: result