code: def test_all_1d_norm_preserving(self):
      # verify that round-trip transforms are norm-preserving
      x = random(30)
      x_norm = np.linalg.norm(x)
      n = x.size * 2
      func_pairs = [
          (np.fft.fft, np.fft.ifft),
          (np.fft.rfft, np.fft.irfft),
          # hfft: order so the first function takes x.size samples
          #       (necessary for comparison to x_norm above)
          (np.fft.ihfft, np.fft.hfft),
      ]
      for forw, back in func_pairs:
          for n in [x.size, 2 * x.size]:
              for norm in [None, "backward", "ortho", "forward"]:
                  tmp = forw(x, n=n, norm=norm)
                  tmp = back(tmp, n=n, norm=norm)
                  assert_allclose(
                      x_norm, np.linalg.norm(tmp), atol=1e-6
                  )
  
imports: import numpy
  import pytest
  from numpy.random import random
  from numpy.testing import assert_array_equal, assert_raises, assert_allclose, IS_WASM
  import threading
  import queue
label_desc: Use image node_id 21 for calling the TestFFT1D obj's underlying member method code with example usage: obj.test_all_1d_norm_preserving() without return types