code: def _copy_context(ctx, context_matches, dict_swap, scope, copy_q):
      if ctx is None:
          return None
  
      # We'd normally check about returning early, but the context won't
      # be copied until after all children are, so we check that first.
  
      graph = tf.get_default_graph()
  
      # copy all nodes within context
      for tensorname in ctx._values:
          tensor = graph.as_graph_element(tensorname)
          copy(tensor, dict_swap, scope, True, copy_q)
  
      # now make sure we haven't already copied the context we're currently
      # trying to copy (in the course of copying another child)
      ctx_copy = _get_context_copy(ctx, scope)
      if ctx_copy:
          return ctx_copy
  
      ctx_copy = ctx.from_proto(ctx.to_proto(), scope[:-1])
      outer_copy = _copy_context(
          ctx.outer_context, context_matches, dict_swap, scope, copy_q
      )
      ctx_copy._outer_context = outer_copy
  
      for name, collection in six.iteritems(graph._collections):
          if ctx in collection:
              graph.add_to_collection(name, ctx_copy)
      return ctx_copy
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import six
  import tensorflow
  from copy import deepcopy
  from edward.models.random_variable import RandomVariable
  from edward.models.random_variables import TransformedDistribution
  from edward.models import PointMass
  from edward.util.graphs import random_variables
  from tensorflow.core.framework import attr_value_pb2
  from tensorflow.python.framework.ops import set_shapes_for_outputs
  from tensorflow.python.util import compat
label_desc: Use image node_id 4 for calling a global function with example usage: _copy_context(ctx, context_matches, dict_swap, scope, copy_q) and returns: ctx_copy, None, ctx_copy