code: def test_dft():
      m = dft(2)
      expected = array([[1.0, 1.0], [1.0, -1.0]])
      assert_array_almost_equal(m, expected)
      m = dft(2, scale="n")
      assert_array_almost_equal(m, expected / 2.0)
      m = dft(2, scale="sqrtn")
      assert_array_almost_equal(m, expected / sqrt(2.0))
  
      x = array([0, 1, 2, 3, 4, 5, 0, 1])
      m = dft(8)
      mx = m.dot(x)
      fx = fft(x)
      assert_array_almost_equal(mx, fx)
  
imports: import pytest
  import numpy
  from numpy import arange, array, eye, copy, sqrt
  from numpy.testing import assert_equal, assert_array_equal, assert_array_almost_equal, assert_allclose
  from pytest import raises
  from scipy.fft import fft
  from scipy.special import comb
  from scipy.linalg import toeplitz, hankel, circulant, hadamard, leslie, dft, companion, kron, block_diag, helmert, hilbert, invhilbert, pascal, invpascal, fiedler, fiedler_companion, eigvals, convolution_matrix
  from numpy.linalg import cond
label_desc: Use image node_id 2 for calling a global function with example usage: test_dft() without return types