code: def _compiled(*args, _fn=None, _self=None, **kwargs):
      """Helper function for optionally XLA compiling `fn`."""
      args = tf.nest.map_structure(tf.convert_to_tensor, args)
      kwargs = tf.nest.map_structure(tf.convert_to_tensor, kwargs)
      if tf.compat.v1.executing_eagerly() or not is_xla_available():
          if _self is not None:
              return _fn(_self, *args, **kwargs)
          else:
              return _fn(*args, **kwargs)
      else:
  
          @tf.function(jit_compile=True)  # allow-tf-function
          def _call_fn(*args, **kwargs):
              if _self is not None:
                  return _fn(_self, *args, **kwargs)
              else:
                  return _fn(*args, **kwargs)
  
          return _call_fn(*args, **kwargs)
  
file_path: agents/tf_agents/utils/xla.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: _compiled() and returns: _call_fn, _fn, _fn, _fn, _fn