code: def to_block_threshold(x: HarmBlockThresholdOptions) -> HarmCategory:
      if isinstance(x, str):
          x = x.lower()
      return _BLOCK_THRESHOLDS[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 4 for calling a global function with example usage: to_block_threshold(x) and returns: _BLOCK_THRESHOLDS