code: def allocate_memory(
      allocate_bytes: int,
      num_chunks: int = 10,
      allocate_interval_s: float = 0,
      post_allocate_sleep_s: float = 0,
  ):
      start = time.time()
      chunks = []
      # divide by 8 as each element in the array occupies 8 bytes
      bytes_per_chunk = allocate_bytes / 8 / num_chunks
      for _ in range(num_chunks):
          chunks.append([0] * ceil(bytes_per_chunk))
          time.sleep(allocate_interval_s)
      end = time.time()
      time.sleep(post_allocate_sleep_s)
      return end - start
  
imports: from math import ceil
  import sys
  import time
  import pytest
  import ray
  from ray._private import ray_constants
  import ray._private.gcs_utils
  from ray._private.test_utils import wait_for_condition, raw_metrics
  import numpy
  from ray._private.utils import get_system_memory
  from ray._private.utils import get_used_memory
  from ray._private.state_api_test_utils import verify_failed_task
  from ray.util.state.state_manager import StateDataSourceClient
label_desc: Use image node_id 4 for calling a global function with example usage: allocate_memory(allocate_bytes, num_chunks, allocate_interval_s, post_allocate_sleep_s) and returns: unknown