code: def allocate(self, bytes_to_allocate: float) -> None:
      # divide by 8 as each element in the array occupies 8 bytes
      new_list = [0] * ceil(bytes_to_allocate / 8)
      self.allocations.append(new_list)
  
file_path: ray/doc/source/ray-core/doc_code/ray_oom_prevention.py
imports: import ray
  import ray
  from math import ceil
  import ray
  from ray._private.utils import get_system_memory
  from ray._private.utils import get_used_memory
label_desc: Use image node_id 2 for calling the MemoryHogger obj's underlying member method code with example usage: obj.allocate(bytes_to_allocate) without return types