code: def _graphDefWithoutDenylistedNodes(self, graph_def):
      output_graph_def = graph_pb2.GraphDef()
      for node in graph_def.node:
          if node.op not in self._OP_TYPE_DENYLIST:
              new_node = output_graph_def.node.add()
              new_node.CopyFrom(node)
  
              if new_node.op == "Enter":
                  # The debugger sets parallel_iterations attribute of while-loop Enter
                  # nodes to 1 for debugging.
                  for attr_key in new_node.attr:
                      if attr_key == "parallel_iterations":
                          new_node.attr[attr_key].i = 1
              elif new_node.op == "Switch" or new_node.op == "Identity":
                  # We don't check the inputs to Switch or Identity ops as their inputs
                  # may be Send/Recv nodes.
                  del new_node.input[:]
  
      return output_graph_def
  
imports: import tempfile
  from tensorflow.core.framework import graph_pb2
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.core.protobuf import rewriter_config_pb2
  from tensorflow.python.client import session
  from tensorflow.python.debug.lib import debug_data
  from tensorflow.python.debug.lib import debug_graphs
  from tensorflow.python.debug.lib import debug_utils
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.ops import while_loop
  from tensorflow.python.platform import test
  from tensorflow.python.training import gradient_descent
label_desc: Use image node_id 4 for calling the ReconstructNonDebugGraphTest obj's underlying member method code with example usage: obj._graphDefWithoutDenylistedNodes(graph_def) and returns: output_graph_def