code: def get_output_signatures_v2(
      func: tf_ext.RestoredFunction,
  ) -> list[tuple[tf_ext.TensorSpec, ...] | tf_ext.TensorSpec]:
      if (
          hasattr(func, "concrete_functions")
          and func.concrete_functions
      ):
          return [
              s
              for conc in func.concrete_functions
              for s in get_output_signatures_v2(conc)
          ]
  
      if hasattr(func, "structured_outputs"):
          # for concrete_functions
          return [func.structured_outputs]
  
      return []
  
imports: from __future__ import annotations
  import importlib.metadata
  import importlib.util
  import logging
  import typing
  from typing import TYPE_CHECKING
  from bentoml.exceptions import BentoMLException
  from ...types import LazyType
  from ...utils.lazy_loader import LazyLoader
label_desc: Use image node_id 8 for calling a global function with example usage: get_output_signatures_v2(func) and returns: list, unknown, list