code: def tree_leaves(tree, is_leaf=None):
      # todo: is_leaf
      if isinstance(tree, (tuple, list)):
          new_struc = []
          for child in tree:
              new_struc += tree_leaves(child)
          return new_struc
      elif isinstance(tree, dict):
          new_struc = []
          for key in sorted(tree):
              new_struc += tree_leaves(tree[key])
          return new_struc
      return [tree]
  
label_desc: Use image node_id 1 for calling a global function with example usage: tree_leaves(tree, is_leaf) and returns: list, new_struc, new_struc