code: def replace_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.outputs):
          if d == dest.name:
              source.outputs[idx] = new_dest.name
              new_dest.inputs = new_dest.inputs[:] + [source.name]
  
      dest.inputs = [i for i in dest.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 5 for calling a global function with example usage: replace_dest(g, source, dest, new_dest) without return types