code: def test_diff():
      # test vector for lag = (1, 2), diff = (1, 2)
      assert_array_equal(diff(x, lag=1, differences=1), np.ones(4))
      assert_array_equal(diff(x, lag=1, differences=2), np.zeros(3))
      assert_array_equal(diff(x, lag=2, differences=1), np.ones(3) * 2)
      assert_array_equal(diff(x, lag=2, differences=2), np.zeros(1))
  
      # test matrix for lag = (1, 2), diff = (1, 2)
      assert_array_equal(
          diff(m, lag=1, differences=1),
          np.array([[-5, -5, -2], [7, -15, 12]]),
      )
      assert_array_equal(
          diff(m, lag=1, differences=2), np.array([[12, -10, 14]])
      )
      assert_array_equal(
          diff(m, lag=2, differences=1), np.array([[2, -20, 10]])
      )
      assert diff(m, lag=2, differences=2).shape[0] == 0
  
imports: from pmdarima.utils.array import diff, diff_inv, c, is_iterable, as_series, check_exog, check_endog
  from pmdarima.utils import get_callable
  from numpy.testing import assert_array_equal, assert_array_almost_equal
  import datetime
  import pytest
  import pandas
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: test_diff() without return types