code: def secondary_training_status_message(
      job_description: dict[str, list[Any]],
      prev_description: dict | None,
  ) -> str:
      """Format string containing start time and the secondary training job status message.
  
      :param job_description: Returned response from DescribeTrainingJob call
      :param prev_description: Previous job description from DescribeTrainingJob call
  
      :return: Job status string to be printed.
      """
      current_transitions = job_description.get(
          "SecondaryStatusTransitions"
      )
      if not current_transitions:
          return ""
  
      prev_transitions_num = 0
      if prev_description is not None:
          if (
              prev_description.get("SecondaryStatusTransitions")
              is not None
          ):
              prev_transitions_num = len(
                  prev_description["SecondaryStatusTransitions"]
              )
  
      transitions_to_print = (
          current_transitions[-1:]
          if len(current_transitions) == prev_transitions_num
          else current_transitions[
              prev_transitions_num - len(current_transitions) :
          ]
      )
  
      status_strs = []
      for transition in transitions_to_print:
          message = transition["StatusMessage"]
          time_utc = timezone.convert_to_utc(
              cast(datetime, job_description["LastModifiedTime"])
          )
          status_strs.append(
              f"{time_utc:%Y-%m-%d %H:%M:%S} {transition['Status']} - {message}"
          )
  
      return "\n".join(status_strs)
  
imports: from __future__ import annotations
  import os
  import re
  import tarfile
  import tempfile
  import time
  import warnings
  from collections import Counter, namedtuple
  from datetime import datetime
  from functools import partial
  from typing import Any, Callable, Generator, cast
  from botocore.exceptions import ClientError
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook
  from airflow.providers.amazon.aws.hooks.logs import AwsLogsHook
  from airflow.providers.amazon.aws.hooks.s3 import S3Hook
  from airflow.providers.amazon.aws.utils.tags import format_tags
  from airflow.utils import timezone
label_desc: Use image node_id 3 for calling a global function with example usage: secondary_training_status_message(job_description, prev_description) and returns: str, str