code: def test_clone(layers):
      dsk1 = {("a", h1): 1, ("a", h2): 2}
      dsk2 = {"b": (add, ("a", h1), ("a", h2))}
      dsk3 = {"c": 1, "d": 1}  # Multiple names
      if layers:
          dsk1 = HighLevelGraph.from_collections("a", dsk1)
          dsk2 = HighLevelGraph(
              {"a": dsk1, "b": dsk2},
              dependencies={"a": set(), "b": {"a"}},
          )
          dsk3 = HighLevelGraph.from_collections("c", dsk3)
      else:
          dsk2.update(dsk1)
  
      t1 = Tuple(dsk1, [("a", h1), ("a", h2)])
      t2 = Tuple(dsk2, ["b"])
      t3 = Tuple(dsk3, ["c"])
  
      c1 = clone(t2, seed=1, assume_layers=layers)
      c2 = clone(t2, seed=1, assume_layers=layers)
      c3 = clone(t2, seed=2, assume_layers=layers)
      c4 = clone(
          c1, seed=1, assume_layers=layers
      )  # Clone of a clone has different keys
      c5 = clone(t2, assume_layers=layers)  # Random seed
      c6 = clone(t2, assume_layers=layers)  # Random seed
      c7 = clone(t2, omit=t1, seed=1, assume_layers=layers)
  
      assert c1.__dask_graph__() == c2.__dask_graph__()
      assert_no_common_keys(c1, t2, layers=layers)
      assert_no_common_keys(c1, c3, layers=layers)
      assert_no_common_keys(c1, c4, layers=layers)
      assert_no_common_keys(c1, c5, layers=layers)
      assert_no_common_keys(c5, c6, layers=layers)
      assert_no_common_keys(c7, t2, omit=t1, layers=layers)
      assert dask.compute(t2, c1, c2, c3, c4, c5, c6, c7) == ((3,),) * 8
  
      # Clone nested; some of the collections in omit are unrelated
      out = clone(
          {"x": [t2]}, omit={"y": [t1, t3]}, assume_layers=layers
      )
      assert dask.compute(out) == ({"x": [(3,)]},)
      c8 = out["x"][0]
      assert_no_common_keys(c8, t2, omit=t1, layers=layers)
      assert_no_common_keys(c8, t3, layers=layers)
  
imports: from __future__ import annotations
  import random
  import time
  from operator import add
  import pytest
  import dask
  import dask.bag
  from dask import delayed
  from dask.base import clone_key
  from dask.blockwise import Blockwise
  from dask.graph_manipulation import bind, checkpoint, chunks, clone, wait_on
  from dask.highlevelgraph import HighLevelGraph
  from dask.tests.test_base import Tuple
  from dask.utils_test import import_or_none
label_desc: Use image node_id 10 for calling a global function with example usage: test_clone(layers) without return types