code: def test_identity_nd(forward, backward, type, shape, axes, norm):
      # Test the identity f^-1(f(x)) == x
  
      x = np.random.random(shape)
  
      if axes is not None:
          shape = np.take(shape, axes)
  
      y = forward(x, type, axes=axes, norm=norm)
      z = backward(y, type, axes=axes, norm=norm)
      assert_allclose(z, x)
  
      if axes is None:
          pad = [(0, 4)] * x.ndim
      elif isinstance(axes, int):
          pad = [(0, 0)] * x.ndim
          pad[axes] = (0, 4)
      else:
          pad = [(0, 0)] * x.ndim
  
          for a in axes:
              pad[a] = (0, 4)
  
      y2 = np.pad(y, pad, mode="edge")
      z2 = backward(y2, type, shape, axes, norm)
      assert_allclose(z2, x)
  
file_path: catboost/contrib/python/scipy/py3/scipy/fft/tests/test_real_transforms.py
imports: import numpy
  from numpy.testing import assert_allclose, assert_array_equal
  import pytest
  from scipy.fft import dct, idct, dctn, idctn, dst, idst, dstn, idstn
  import scipy.fft
  from scipy import fftpack
label_desc: Use image node_id 3 for calling a global function with example usage: test_identity_nd(forward, backward, type, shape, axes, norm) without return types