code: def to_new_harm_category(x: HarmCategoryOptions) -> HarmCategory:
      if isinstance(x, str):
          x = x.lower()
      return _NEW_HARM_CATEGORIES[x]
  
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 2 for calling a global function with example usage: to_new_harm_category(x) and returns: _NEW_HARM_CATEGORIES