code: def test_treeapply_leaf():
      assert treeapply(3, {}, leaf=lambda x: x**2) == 9
      tree = ([3, 3], [4, 1], 2)
      treep1 = ([4, 4], [5, 2], 3)
      assert treeapply(
          tree, {list: min, tuple: max}, leaf=lambda x: x + 1
      ) == treeapply(treep1, {list: min, tuple: max})
  
file_path: sympy/sympy/strategies/tests/test_tree.py
imports: from sympy.strategies.tree import treeapply, greedy, allresults, brute
  from functools import partial, reduce
label_desc: Use image node_id 8 for calling a global function with example usage: test_treeapply_leaf() without return types