code: def test_with_counter():
      """
      >>> from river import utils
      >>> import collections
      >>> collections.Counter.revert = collections.Counter.subtract
  
      >>> counter = utils.Rolling(collections.Counter(), window_size=3)
  
      >>> for i in range(5):
      ...     counter.update([i])
  
      >>> counter
      Counter({2: 1, 3: 1, 4: 1, 0: 0, 1: 0})
  
      >>> counter.most_common(3)
      [(2, 1), (3, 1), (4, 1)]
  
      >>> counter[4]
      1
  
      """
  
file_path: river/river/utils/test_rolling.py
imports: from __future__ import annotations
  import datetime
  import pytest
  from river import proba, stats, utils
label_desc: Use image node_id 1 for calling a global function with example usage: test_with_counter() without return types