(nodes)
return leaves
Return a list containing the leaves of the graph defined by nodes.
Return a list containing the leaves of the graph defined by nodes.
Return a list containing the leaves of the graph defined by nodes .
def get_leaves(nodes):
  """Return a list containing the leaves of the graph defined by nodes."""
  leaves = []
  for n in nodes:
    if not n.children:
      leaves.append(n)
  return leaves
def get_leaves ( nodes ) : leaves = [ ] for n in nodes : if not n . children : leaves . append ( n ) return leaves