code: def get_descendants(x, collection=None):
      """Get descendant random variables of input.
  
      Args:
        x: RandomVariable or tf.Tensor.
          Query node to find descendants of.
        collection: list of RandomVariable.
          The collection of random variables to check with respect to;
          defaults to all random variables in the graph.
  
      Returns:
        list of RandomVariable.
        Descendant random variables of x.
  
      #### Examples
  
      ```python
      a = Normal(0.0, 1.0)
      b = Normal(a, 1.0)
      c = Normal(a, 1.0)
      d = Normal(c, 1.0)
      assert set(ed.get_descendants(a)) == set([b, c, d])
      ```
      """
      if collection is None:
          collection = random_variables()
  
      node_dict = {node.value(): node for node in collection}
  
      # Traverse the graph. Add each node to the set if it's in the collection.
      output = set()
      visited = set()
      nodes = {x}
      while nodes:
          node = nodes.pop()
  
          if node in visited:
              continue
          visited.add(node)
  
          if isinstance(node, RandomVariable):
              node = node.value()
  
          candidate_node = node_dict.get(node, None)
          if candidate_node is not None and candidate_node != x:
              output.add(candidate_node)
  
          for op in node.consumers():
              nodes.update(op.outputs)
  
      return list(output)
  
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 10 for calling a global function with example usage: get_descendants(x, collection) and returns: list