code: def test_range_query():
      sm = SystemMonitor(maxlen=5)
  
      assert all(len(v) == 1 for v in sm.range_query(0).values())
      assert all(len(v) == 0 for v in sm.range_query(123).values())
  
      sm.update()
      sm.update()
      sm.update()
  
      assert all(len(v) == 4 for v in sm.range_query(0).values())
      assert all(len(v) == 3 for v in sm.range_query(1).values())
  
      for _ in range(10):
          sm.update()
  
      assert all(len(v) == 4 for v in sm.range_query(10).values())
      assert all(len(v) == 5 for v in sm.range_query(0).values())
  
file_path: distributed/distributed/tests/test_system_monitor.py
imports: from __future__ import annotations
  from time import sleep
  import pytest
  import dask
  from distributed.system_monitor import SystemMonitor
label_desc: Use image node_id 4 for calling a global function with example usage: test_range_query() without return types