code: def run_actor_task(self, max_depth, spawn_task, expected_depth=1):
      task_depth = ray._private.worker.global_worker.task_depth
      assert task_depth == expected_depth
  
      if expected_depth < max_depth:
          if spawn_task:
              ray.get(
                  nested_task.remote(
                      max_depth,
                      spawn_task,
                      expected_depth + 1,
                  )
              )
          else:
              nested_actor = NestedActor.remote(expected_depth + 1)
              ray.get(
                  nested_actor.run_actor_task.remote(
                      max_depth, spawn_task, expected_depth + 1
                  )
              )
  
file_path: ray/python/ray/tests/test_nested_task.py
imports: import sys
  import threading
  import pytest
  import ray
label_desc: Use image node_id 2 for calling the NestedActor obj's underlying member method code with example usage: obj.run_actor_task(max_depth, spawn_task, expected_depth) without return types