code: def disable_v2_behavior():
      """Disables TensorFlow 2.x behaviors.
  
      This function can be called at the beginning of the program (before `Tensors`,
      `Graphs` or other structures have been created, and before devices have been
      initialized. It switches all global behaviors that are different between
      TensorFlow 1.x and 2.x to behave as intended for 1.x.
  
      User can call this function to disable 2.x behavior during complex migrations.
  
      @compatibility(TF2)
      Using this function indicates that your software is not compatible
      with eager execution and `tf.function` in TF2.
  
      To migrate to TF2, rewrite your code to be compatible with eager execution.
      Please refer to the [migration guide]
      (https://www.tensorflow.org/guide/migrate) for additional resource on the
      topic.
      @end_compatibility
      """
      _v2_behavior_usage_gauge.get_cell("disable").set(True)
      tf2.disable()
      ops.disable_eager_execution()
      tensor_shape.disable_v2_tensorshape()  # Also switched by tf2
      resource_variables_toggle.disable_resource_variables()
      tensor.disable_tensor_equality()
      # Disables TensorArrayV2 and control flow V2.
      control_flow_v2_toggles.disable_control_flow_v2()
      # Make sure internal uses of tf.data symbols map to V1 versions.
      for v2_disabler_name in _DATA_V2_CALLBACKS.list():
          v2_disabler = _DATA_V2_CALLBACKS.lookup(v2_disabler_name)
          v2_disabler()
  
file_path: tensorflow/tensorflow/python/compat/v2_compat.py
imports: from tensorflow.python import tf2
  from tensorflow.python.eager import monitoring
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import registry
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import tensor_shape
  from tensorflow.python.ops import control_flow_v2_toggles
  from tensorflow.python.ops import resource_variables_toggle
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 3 for calling a global function with example usage: disable_v2_behavior() without return types