code: def test_undiff(differencer):
      Y = [random.random() for _ in range(max(differencer.coeffs))]
      p = random.random()
  
      diffed = differencer.diff(p, Y)
      undiffed = differencer.undiff(diffed, Y)
      assert math.isclose(undiffed, p)
  
file_path: river/river/time_series/test_snarimax.py
imports: from __future__ import annotations
  import calendar
  import math
  import random
  import pytest
  import sympy
  from river import compose, datasets, metrics, time_series
  from river.time_series.snarimax import Differencer
label_desc: Use image node_id 3 for calling a global function with example usage: test_undiff(differencer) without return types