code: def to_tools(tools: ToolsType) -> list[glm.Tool]:
      if tools is None:
          return []
      elif isinstance(tools, Mapping):
          return [glm.Tool(tools)]
      elif isinstance(tools, Iterable):
          return [glm.Tool(t) for t in tools]
      else:
          return [glm.Tool(tools)]
  
imports: from __future__ import annotations
  from collections.abc import Iterable, Mapping
  import io
  import mimetypes
  import pathlib
  import typing
  from typing import Any, TypedDict, Union
  from google.ai import generativelanguage
label_desc: Use image node_id 12 for calling a global function with example usage: to_tools(tools) and returns: list, list, unknown, list