code: def EnableControlFlowV2(graph):
      """Returns whether control flow v2 should be used in `graph`."""
      # Enable new control flow in FuncGraphs (but not legacy _FuncGraphs).
      # TODO(skyewm): do something better than hasattr without messing up imports.
      return ENABLE_CONTROL_FLOW_V2 or (
          graph.building_function and not hasattr(graph, "_captured")
      )
  
imports: import os
  import traceback
  from tensorflow.python import tf2
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 2 for calling a global function with example usage: EnableControlFlowV2(graph) and returns: unknown