code: def test_postsubmit_all(ray_start_1_cpu):
      """
      Test that postsubmit_all is called once.
      """
  
      class PostsubmitAllCallback(RayDaskCallback):
          def __init__(self, postsubmit_all_actor):
              self.postsubmit_all_actor = postsubmit_all_actor
  
          def _ray_postsubmit_all(self, object_refs, dsk):
              self.postsubmit_all_actor.postsubmit_all.remote(
                  object_refs, dsk
              )
  
      @ray.remote
      class PostsubmitAllActor:
          def __init__(self):
              self.postsubmit_all_called = False
  
          def postsubmit_all(self, object_refs, dsk):
              self.postsubmit_all_called = True
  
          def get_postsubmit_all_called(self):
              return self.postsubmit_all_called
  
      postsubmit_all_actor = PostsubmitAllActor.remote()
      with PostsubmitAllCallback(postsubmit_all_actor):
          z = add(2, 3)
          result = z.compute(scheduler=ray_dask_get)
  
      assert ray.get(
          postsubmit_all_actor.get_postsubmit_all_called.remote()
      )
      assert result == 5
  
file_path: ray/python/ray/util/dask/tests/test_dask_callback.py
imports: import dask
  import pytest
  import ray
  from ray.util.dask import ray_dask_get, RayDaskCallback
label_desc: Use image node_id 7 for calling a global function with example usage: test_postsubmit_all(ray_start_1_cpu) and returns: self