code: def derive_from_graph(func_graph):
      """Derives a FunctionType from FuncGraph."""
      # TODO(fmuham): Include structure info from structured_inputs
      input_signature = (
          tuple(trace_type.from_value(i) for i in func_graph.inputs),
          {},
      )
  
      # TODO(fmuham): Include output structure info from structured_outputs
      output_signature = tuple(
          trace_type.from_value(o) for o in func_graph.outputs
      )
  
      return function_type_lib.from_structured_signature(
          input_signature,
          output_signature,
          func_graph.function_captures.capture_types,
      )
  
imports: import functools
  import inspect
  from typing import Any, Dict, Tuple
  import six
  from tensorflow.core.function import trace_type
  from tensorflow.core.function.polymorphism import function_type
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import type_spec
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.util import nest
label_desc: Use image node_id 14 for calling a global function with example usage: derive_from_graph(func_graph) and returns: function_type_lib