code: def _deserialize_function_spec_as_nonmethod(function_spec_proto):
      """Deserialize a FunctionSpec object from its proto representation."""
      typeless_fullargspec = nested_structure_coder.decode_proto(
          function_spec_proto.fullargspec
      )
  
      # Convert a method function into a non method.
      if function_spec_proto.is_method or (
          typeless_fullargspec.args
          and typeless_fullargspec.args[0] == "self"
      ):
          if not typeless_fullargspec.args:
              raise NotImplementedError(
                  "Cannot deserialize a method function without a named "
                  "'self' argument."
              )
          args = typeless_fullargspec.args[1:]
      else:
          args = typeless_fullargspec.args
  
      fullargspec = tf_inspect.FullArgSpec(
          args=args,
          varargs=typeless_fullargspec.varargs,
          varkw=typeless_fullargspec.varkw,
          defaults=typeless_fullargspec.defaults,
          kwonlyargs=typeless_fullargspec.kwonlyargs,
          kwonlydefaults=typeless_fullargspec.kwonlydefaults,
          annotations=typeless_fullargspec.annotations,
      )
      input_signature = nested_structure_coder.decode_proto(
          function_spec_proto.input_signature
      )
  
      # See `tf.function` and the JitCompile proto for details.
      jit_compile = {
          saved_object_graph_pb2.FunctionSpec.JitCompile.DEFAULT: None,
          saved_object_graph_pb2.FunctionSpec.JitCompile.ON: True,
          saved_object_graph_pb2.FunctionSpec.JitCompile.OFF: False,
      }.get(function_spec_proto.jit_compile)
  
      return function_type_utils.FunctionSpec.from_fullargspec_and_signature(
          fullargspec=fullargspec,
          input_signature=input_signature,
          jit_compile=jit_compile,
      )
  
imports: import collections
  import pprint
  import re
  from absl import logging
  from tensorflow.core.function import trace_type
  from tensorflow.core.function.polymorphism import function_type
  from tensorflow.core.protobuf import saved_object_graph_pb2
  from tensorflow.python.eager import def_function
  from tensorflow.python.eager import function
  from tensorflow.python.eager.polymorphic_function import function_type_utils
  from tensorflow.python.framework import func_graph
  from tensorflow.python.framework import function_def_to_graph
  from tensorflow.python.framework import op_def_registry
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import type_spec
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import custom_gradient
  from tensorflow.python.ops import default_gradient
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.saved_model import nested_structure_coder
  from tensorflow.python.util import compat
  from tensorflow.python.util import nest
  from tensorflow.python.util import tf_decorator
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 5 for calling a global function with example usage: _deserialize_function_spec_as_nonmethod(function_spec_proto) and returns: function_type_utils