code: def strip_and_get_tensors_and_control_dependencies(
      flat_tensor_list: Iterable[tf.Tensor],
  ) -> Tuple[Iterable[tf.Tensor], Iterable[tf.Operation]]:
      """Strips automatic control dependencies from `flat_tensor_list`.
  
      Args:
        flat_tensor_list: A flattened list of output tensors from a tf.function.
  
      Returns:
        A tuple of:
          Tensors from `flat_tensor_list` with control dependencies removed.
          The set of control dependency ops that `flat_tensor_list` depended on.
      """
      # If an automatic control dependency node was added, all tensors in
      # `flat_tensor_list` will be the result of Identity ops with the original
      # tensor as an input and the automatic control dependencies as control inputs.
      if all(
          tensor.op.type == "Identity" and len(tensor.op.inputs) == 1
          for tensor in flat_tensor_list
      ):
          control_dependency_ops = [
              t.op.control_inputs for t in flat_tensor_list
          ]
          return (
              [t.op.inputs[0] for t in flat_tensor_list],
              set(itertools.chain(*control_dependency_ops)),
          )
      else:
          return flat_tensor_list, set()
  
file_path: transform/tensorflow_transform/tf2_utils.py
imports: import copy
  import itertools
  from typing import Collection, Iterable, Mapping, Optional, Tuple
  import tensorflow
  from tensorflow_transform import common_types
  from tensorflow.python import tf2
  from tensorflow.python.framework.func_graph import FuncGraph
label_desc: Use image node_id 2 for calling a global function with example usage: strip_and_get_tensors_and_control_dependencies(flat_tensor_list) and returns: unknown,  set, flat_tensor_list,  set