code: def task_with_nested_actor(
      first_fraction,
      second_fraction,
      leaker,
      actor_allocation_first=True,
  ):
      first_bytes = get_additional_bytes_to_reach_memory_usage_pct(
          first_fraction
      )
      second_bytes = (
          get_additional_bytes_to_reach_memory_usage_pct(
              second_fraction
          )
          - first_bytes
      )
      if actor_allocation_first:
          ray.get(leaker.allocate.remote(first_bytes))
          dummy = alloc_mem(second_bytes)
      else:
          dummy = alloc_mem(first_bytes)
          ray.get(leaker.allocate.remote(second_bytes))
      return dummy[0]
  
imports: import sys
  import threading
  import pytest
  import ray
  from ray.tests.test_memory_pressure import allocate_memory, Leaker, get_additional_bytes_to_reach_memory_usage_pct, memory_usage_threshold, memory_monitor_refresh_ms
label_desc: Use image node_id 3 for calling a global function with example usage: task_with_nested_actor(first_fraction, second_fraction, leaker, actor_allocation_first) and returns: dummy