code: def replace_control_dest(g, source, dest, new_dest):
      if isinstance(source, six.string_types):
          source = g[source]
      if isinstance(dest, six.string_types):
          dest = g[dest]
      if isinstance(new_dest, six.string_types):
          new_dest = g[new_dest]
      for idx, d in enumerate(source.control_outputs):
          if d == dest.name:
              source.control_outputs[idx] = new_dest.name
              new_dest.control_inputs = new_dest.control_inputs[:] + [
                  source.name
              ]
  
      dest.control_inputs = [
          i for i in dest.control_inputs if i != source.name
      ]
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import six
label_desc: Use image node_id 6 for calling a global function with example usage: replace_control_dest(g, source, dest, new_dest) without return types