code: def function(func: Callable) -> Callable:
      """
      Compiling a function into a callable TensorFlow graph.
  
      Do not use this decorator in every function, just in upper function.
      Because 'tf.function' decorator require function's input and output
      to be tensorflow tensors, so we need to transform tfe tensors to
      tensorflow tensors and transform inversely.
      """
  
      @tf.function
      def graph_function(args, kwargs):
          args, kwargs = input_wrap(args, kwargs)
          result = func(*args, **kwargs)
          result = unwrap_func(result)
          return result
  
      @functools.wraps(func)
      def wrap_function(*args: Any, **kwargs: Any) -> AbstractTensor:
          if get_config().debug:
              return func(*args, **kwargs)
  
          args, kwargs = input_unwrap(args, kwargs)
          result = graph_function(args, kwargs)
          result = wrap_func(result)
  
          return result
  
      return wrap_function
  
imports: import functools
  from abc import ABC
  from types import TracebackType
  from typing import Any
  from typing import Callable
  from typing import Optional
  import tensorflow
  import tf_encrypted
  from ..config import get_config
  from ..tensor.factory import AbstractTensor
label_desc: Use image node_id 7 for calling a global function with example usage: function(func) and returns: wrap_function, result, result, func