code: def tf_function(tf_module):
      """Conditional decorator for @tf.function.
  
      Use @tf_function(tf) instead to avoid errors if tf is not installed.
      """
  
      # The actual decorator to use (pass in `tf` (which could be None)).
      def decorator(func):
          # If tf not installed -> return function as is (won't be used anyways).
          if tf_module is None or tf_module.executing_eagerly():
              return func
          # If tf installed, return @tf.function-decorated function.
          return tf_module.function(func)
  
      return decorator
  
imports: import logging
  import numpy
  import os
  import sys
  from typing import Any, Optional
  from ray.rllib.utils.annotations import DeveloperAPI, PublicAPI
  from ray.rllib.utils.deprecation import Deprecated
  from ray.rllib.utils.typing import TensorShape, TensorType
label_desc: Use image node_id 3 for calling a global function with example usage: tf_function(tf_module) and returns: decorator, tf_module, func