code: def get_preinitialized_function_spec(concrete_function):
      """Generates an unconstrained FunctionSpec from FunctionType."""
      # TODO(b/203440205): SavedModel does not support FunctionType on its own
      # without a FuncGraph signature.
      # WrappedFunctions are not supposed to have FunctionSpecs.
      if (
          concrete_function.structured_input_signature is None
          or isinstance(
              concrete_function, wrap_function_lib.WrappedFunction
          )
      ):
          return None
  
      function_type = concrete_function.function_type
      if function_type is None:
          return None
  
      unconstrained_type = function_type_lib.FunctionType(
          [
              function_type_lib.Parameter(
                  p.name, p.kind, p.optional, None
              )
              for p in function_type.parameters.values()
          ]
      )
      default_values = {
          p.default
          for p in function_type.parameters.values()
          if p.optional
      }
      return function_type_utils.FunctionSpec(
          unconstrained_type,
          default_values,
          False,
          name=concrete_function.name,
      )
  
file_path: tensorflow-upstream/tensorflow/python/saved_model/function_serialization.py
imports: from tensorflow.core.function.polymorphism import function_type
  from tensorflow.core.protobuf import saved_object_graph_pb2
  from tensorflow.python.eager import function
  from tensorflow.python.eager import wrap_function
  from tensorflow.python.eager.polymorphic_function import function_type_utils
  from tensorflow.python.framework import func_graph
  from tensorflow.python.saved_model import nested_structure_coder
  from tensorflow.python.util import nest
label_desc: Use image node_id 3 for calling a global function with example usage: get_preinitialized_function_spec(concrete_function) and returns: function_type_utils, None, None