code: def to_easy_safety_dict(
      settings: SafetySettingOptions, harm_category_set
  ) -> EasySafetySettingDict:
      if settings is None:
          return {}
      elif isinstance(settings, Mapping):
          return {
              to_harm_category(
                  key, harm_category_set
              ): to_block_threshold(value)
              for key, value in settings.items()
          }
      else:  # Iterable
          return {
              to_harm_category(
                  d["category"], harm_category_set
              ): to_block_threshold(d["threshold"])
              for d in settings
          }
  
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 8 for calling a global function with example usage: to_easy_safety_dict(settings, harm_category_set) and returns: dict, unknown, unknown