code: def test_deallocation() -> None:
      allocator = BlockedAllocator(16)
  
      # Allocate
      all_blocks = allocator.allocate(16)
      assert allocator.free_blocks == 0
  
      # Deallocate all blocks
      allocator.free(all_blocks)
      assert allocator.free_blocks == 16
  
      # Get all the blocks again
      all_blocks = allocator.allocate(16)
  
      # Deallocate in chunks
      c1 = all_blocks[:4]
      c2 = all_blocks[4:8]
  
      allocator.free(c1)
      assert allocator.free_blocks == 4
  
      allocator.free(c2)
      assert allocator.free_blocks == 8
  
      with pytest.raises(ValueError):
          allocator.free(c1)
  
      with pytest.raises(ValueError):
          allocator.free(c2)
  
file_path: deepspeed/tests/unit/inference/v2/ragged/test_blocked_allocator.py
imports: import random
  from typing import List
  import pytest
  import torch
  from deepspeed.inference.v2.ragged.blocked_allocator import BlockedAllocator
label_desc: Use image node_id 4 for calling a global function with example usage: test_deallocation() without return types