code: def apply_transform(f, transform_fn):
      """Wrapper to apply a transformation on every traced tf.function."""
  
      @def_function.function
      def wrapped(*args):
          updated_cf = transform.transform_function(
              f, inputs=args, transform_fn=transform_fn
          )
          return updated_cf(*args)
  
      return wrapped
  
imports: import collections
  from absl.testing import parameterized
  from tensorflow.core.function.testing import test_pass
  from tensorflow.core.function.transform import transform
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.framework import test_util
  from tensorflow.python.module import module
  from tensorflow.python.ops import custom_gradient
  from tensorflow.python.ops import gradients_impl
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import while_loop
  from tensorflow.python.platform import test
  from tensorflow.python.saved_model import load
  from tensorflow.python.saved_model import save
label_desc: Use image node_id 2 for calling a global function with example usage: apply_transform(f, transform_fn) and returns: wrapped, updated_cf