code: def tree_flatten(tree):
      """Flatten a tree into a list."""
      if isinstance(tree, (list, tuple)):
          # In python, sum of lists starting from [] is the concatenation.
          return sum([tree_flatten(t) for t in tree], [])
      if isinstance(tree, dict):
          # Only use the values in case of a dictionary node.
          return sum([tree_flatten(v) for v in tree.values()], [])
      return [tree]
  
file_path: trax/trax/fastmath/numpy.py
imports: import numpy
  from scipy.special import logsumexp
  from trax.shapes import signature
label_desc: Use image node_id 11 for calling a global function with example usage: tree_flatten(tree) and returns: list, sum, sum