code: def subgraph_leaves(subgraph):
      """Returns a list of leaf nodes from extract_subgraph()."""
      if len(subgraph) == 1:
          return subgraph
      result = []
      for input in subgraph[1:]:
          result += subgraph_leaves(input)
      return tuple(result)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import edward.inferences.conjugacy.conjugate_log_probs
  import numpy
  import six
  import tensorflow
  import time
  from collections import defaultdict
  from edward.inferences.conjugacy.simplify import symbolic_suff_stat, full_simplify, expr_contains, reconstruct_expr
  from edward.models.random_variables import *
  from edward.util import copy, get_blanket
label_desc: Use image node_id 8 for calling a global function with example usage: subgraph_leaves(subgraph) and returns: tuple, subgraph