code: def test_all_1d_norm_preserving(self, xp):
      # verify that round-trip transforms are norm-preserving
      x = xp.asarray(random(30))
      xp_test = array_namespace(x)
      x_norm = xp_test.linalg.vector_norm(x)
      n = size(x) * 2
      func_pairs = [
          (fft.fft, fft.ifft),
          (fft.rfft, fft.irfft),
          # hfft: order so the first function takes x.size samples
          #       (necessary for comparison to x_norm above)
          (fft.ihfft, fft.hfft),
      ]
      for forw, back in func_pairs:
          for n in [size(x), 2 * size(x)]:
              for norm in ["backward", "ortho", "forward"]:
                  tmp = forw(x, n=n, norm=norm)
                  tmp = back(tmp, n=n, norm=norm)
                  xp_assert_close(
                      xp_test.linalg.vector_norm(tmp), x_norm
                  )
  
imports: import queue
  import threading
  import multiprocessing
  import numpy
  import pytest
  from numpy.random import random
  from numpy.testing import assert_array_almost_equal, assert_allclose
  from pytest import raises
  import scipy.fft
  from scipy.conftest import array_api_compatible, skip_if_array_api_backend
  from scipy._lib._array_api import array_namespace, size, xp_assert_close, xp_assert_equal
label_desc: Use image node_id 25 for calling the TestFFT1D obj's underlying member method code with example usage: obj.test_all_1d_norm_preserving(xp) without return types