code: def test_preorder_traversal():
      t = (add, 1, 2)
      assert list(preorder_traversal(t)) == [add, 1, 2]
      t = (add, (add, 1, 2), (add, 3, 4))
      assert list(preorder_traversal(t)) == [add, add, 1, 2, add, 3, 4]
      t = (add, (sum, [1, 2]), 3)
      assert list(preorder_traversal(t)) == [add, sum, list, 1, 2, 3]
  
imports: from __future__ import annotations
  import pickle
  from collections import namedtuple
  import pytest
  from dask.core import flatten, get, get_dependencies, get_deps, getcycle, has_tasks, ishashable, iskey, istask, literal, preorder_traversal, quote, subs, validate_key
  from dask.utils_test import GetFunctionTestMixin, add, inc
label_desc: Use image node_id 8 for calling a global function with example usage: test_preorder_traversal() without return types