code: def delete_disconnected_nodes(gd):
      # delete all nodes with no inputs and outputs
      empty_nodes = []
      for k, v in gd.items():
          if (
              len(gd[k].inputs) == 0
              and len(gd[k].outputs) == 0
              and len(gd[k].control_inputs) == 0
              and len(gd[k].control_outputs) == 0
              and gd[k].op != "Placeholder"
          ):
              empty_nodes.append(k)
  
      for k in empty_nodes:
          del gd[k]
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
label_desc: Use image node_id 1 for calling a global function with example usage: delete_disconnected_nodes(gd) without return types