code: def enable_v2_behavior():
      """Enables 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 2.x.
  
      This function is called in the main TensorFlow `__init__.py` file, user should
      not need to call it, except during complex migrations.
  
      @compatibility(TF2)
      This function is not necessary if you are using TF2. V2 behavior is enabled by
      default.
      @end_compatibility
      """
      _v2_behavior_usage_gauge.get_cell("enable").set(True)
      # TF2 behavior is enabled if either 1) enable_v2_behavior() is called or
      # 2) the TF2_BEHAVIOR=1 environment variable is set.  In the latter case,
      # the modules below independently check if tf2.enabled().
      tf2.enable()
      ops.enable_eager_execution()
      tensor_shape.enable_v2_tensorshape()  # Also switched by tf2
      resource_variables_toggle.enable_resource_variables()
      tensor.enable_tensor_equality()
      # Enables TensorArrayV2 and control flow V2.
      control_flow_v2_toggles.enable_control_flow_v2()
      # Make sure internal uses of tf.data symbols map to V2 versions.
      for v2_enabler_name in _DATA_V2_CALLBACKS.list():
          v2_enabler = _DATA_V2_CALLBACKS.lookup(v2_enabler_name)
          v2_enabler()
  
file_path: tensorflow-upstream/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 2 for calling a global function with example usage: enable_v2_behavior() without return types