code: def test_sub(stat):
      A = copy.deepcopy(stat)
      B = copy.deepcopy(stat)
      C = copy.deepcopy(stat)
  
      X = [random.random() for _ in range(30)]
      Y = [random.random() for _ in range(30)]
      W = [random.random() for _ in range(30)]
  
      for x, y, w in zip(X, Y, W):
          A.update(x, w)
          B.update(y, w)
          C.update(x, w)
          C.update(y, w)
  
      D = C - B
      assert math.isclose(D.get(), A.get())
  
      C -= B
      assert math.isclose(C.get(), A.get())
  
file_path: river/river/stats/test_parallel.py
imports: from __future__ import annotations
  import copy
  import math
  import random
  import numpy
  import pytest
  from river import stats
label_desc: Use image node_id 4 for calling a global function with example usage: test_sub(stat) without return types