code: def test_overwrite(
      routine, dtype, shape, axis, type, norm, overwrite_x
  ):
      # Check input overwrite behavior
      np.random.seed(1234)
      if np.issubdtype(dtype, np.complexfloating):
          x = np.random.randn(*shape) + 1j * np.random.randn(*shape)
      else:
          x = np.random.randn(*shape)
      x = x.astype(dtype)
      x2 = x.copy()
      routine(x2, type, None, axis, norm, overwrite_x=overwrite_x)
  
      sig = "%s(%s%r, %r, axis=%r, overwrite_x=%r)" % (
          routine.__name__,
          x.dtype,
          x.shape,
          None,
          axis,
          overwrite_x,
      )
      if not overwrite_x:
          assert_equal(x2, x, err_msg="spurious overwrite in %s" % sig)
  
imports: from os.path import join, dirname
  from typing import Callable, Dict, Tuple, Union, Type
  import numpy
  from numpy.testing import assert_array_almost_equal, assert_equal, assert_allclose
  import pytest
  from pytest import raises
  from scipy.fft._pocketfft.realtransforms import dct, idct, dst, idst, dctn, idctn, dstn, idstn
label_desc: Use image node_id 23 for calling a global function with example usage: test_overwrite(routine, dtype, shape, axis, type, norm, overwrite_x) without return types