code: def get_config_proto_v1(enable_xla=False):
      """Return config proto according to flag settings, or None to use default."""
      config = None
      if enable_xla:
          config = tf.compat.v1.ConfigProto()
          config.graph_options.optimizer_options.global_jit_level = (
              tf.OptimizerOptions.ON_2
          )
          # Disable PinToHostOptimizer in grappler when enabling XLA because it causes
          # OOM and performance regression.
          config.graph_options.rewrite_options.pin_to_host_optimization = (
              rewriter_config_pb2.RewriterConfig.OFF
          )
      return config
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import time
  import tensorflow
  from tensorflow.core.protobuf import rewriter_config_pb2
  from tensorflow.python import tf2
  from tensorflow.python.eager import profiler
label_desc: Use image node_id 3 for calling a global function with example usage: get_config_proto_v1(enable_xla) and returns: config