code: def convert_candidate_enums(candidates):
      result = []
      for candidate in candidates:
          candidate = candidate.copy()
          candidate["safety_ratings"] = convert_ratings_to_enum(
              candidate["safety_ratings"]
          )
          result.append(candidate)
      return result
  
imports: from __future__ import annotations
  from collections.abc import Mapping
  import typing
  from typing import Dict, Iterable, List, Union
  from typing_extensions import TypedDict
  from google.ai import generativelanguage
  from google.generativeai import string_utils
label_desc: Use image node_id 12 for calling a global function with example usage: convert_candidate_enums(candidates) and returns: result