code: def test_calculate_dft_matrix(self, onesided):
      expected_C = np.zeros((16, 16))
      expected_S = np.zeros((16, 16))
  
      _range = np.arange(16)
      for k in range(16):
          expected_C[k, :] = np.cos(2 * np.pi * k * _range / 16)
          expected_S[k, :] = np.sin(2 * np.pi * k * _range / 16)
  
      if onesided:
          expected_C = expected_C[:9]
          expected_S = expected_S[:9]
  
      @mb.program(input_specs=[mb.TensorSpec(shape=(1,))])
      def prog(x):
          return _calculate_dft_matrix(x, onesided=onesided)
  
      model = ct_convert(
          program=prog,
          convert_to=("neuralnetwork", "fp32"),
          compute_units=ComputeUnit.CPU_ONLY,
      )
      p = model.predict({"x": np.array([16.0])})
      cos_matrix, sin_matrix = p["cos_0"], p["sin_0"]
  
      np.testing.assert_allclose(
          expected_C, cos_matrix, atol=1e-04, rtol=1e-05
      )
      np.testing.assert_allclose(
          expected_S, sin_matrix, atol=1e-04, rtol=1e-05
      )
  
file_path: coremltools/coremltools/converters/mil/mil/passes/tests/test_lower_complex_dialect_ops.py
imports: import numpy
  import pytest
  from coremltools import ComputeUnit
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil.passes.defs.lower_complex_dialect_ops import _calculate_dft_matrix
  from coremltools.converters.mil.testing_utils import apply_pass_and_basic_check, assert_model_is_valid, ct_convert, get_op_types_in_program
label_desc: Use image node_id 3 for calling the TestLowerComplexDialectOps obj's underlying member method code with example usage: obj.test_calculate_dft_matrix(onesided) and returns: _calculate_dft_matrix