code: def _validate(
      self,
      array_type,
      test_shape,
      dtype,
      s,
      kwargs,
      copy_func=copy.copy,
  ):
      input_array = self.munge_input_array(
          array_type(test_shape, dtype), kwargs
      )
  
      orig_input_array = copy_func(input_array)
  
      np_input_array = numpy.asarray(input_array)
  
      # Why are long double inputs copied to double precision? It's what
      # numpy silently does anyways as of v1.10 but helps with backward
      # compatibility and scipy.
      # https://github.com/pyFFTW/pyFFTW/pull/189#issuecomment-356449731
      if np_input_array.dtype == "clongdouble":
          np_input_array = numpy.complex128(input_array)
  
      elif np_input_array.dtype == "longdouble":
          np_input_array = numpy.float64(input_array)
  
      with warnings.catch_warnings(record=True) as w:
          # We catch the warnings so as to pick up on when
          # a complex array is turned into a real array
  
          if "axes" in kwargs:
              validator_kwargs = {"axes": kwargs["axes"]}
          elif "axis" in kwargs:
              validator_kwargs = {"axis": kwargs["axis"]}
          else:
              validator_kwargs = {}
  
          if self.has_norm_kwarg and "norm" in kwargs:
              validator_kwargs["norm"] = kwargs["norm"]
  
          try:
              test_out_array = getattr(
                  self.validator_module, self.func
              )(copy_func(np_input_array), s, **validator_kwargs)
  
          except Exception as e:
              interface_exception = None
              try:
                  getattr(self.test_interface, self.func)(
                      copy_func(input_array), s, **kwargs
                  )
              except Exception as _interface_exception:
                  # It's necessary to assign the exception to the
                  # already defined variable in Python 3.
                  # See http://www.python.org/dev/peps/pep-3110/#semantic-changes
                  interface_exception = _interface_exception
  
              # If the test interface raised, so must this.
              self.assertEqual(
                  type(interface_exception),
                  type(e),
                  msg="Interface exception raised. "
                  + "Testing for: "
                  + repr(e),
              )
              return
          try:
              output_array = getattr(self.test_interface, self.func)(
                  copy_func(np_input_array), s, **kwargs
              )
          except NotImplementedError as e:
              # check if exception due to missing precision
              msg = repr(e)
              if "Rebuild pyFFTW with support for" in msg:
                  self.skipTest(msg)
              else:
                  raise
  
          if functions[self.func] == "r2c":
              if numpy.iscomplexobj(input_array):
                  if len(w) > 0:
                      # Make sure a warning is raised
                      self.assertIs(
                          w[-1].category, numpy.ComplexWarning
                      )
  
      self.assertTrue(
          numpy.allclose(
              output_array, test_out_array, rtol=1e-2, atol=1e-4
          )
      )
  
      if (
          _all_types_np.get(np_input_array.real.dtype, "")
          in _supported_types
      ):
          # supported precisions should not be converted
          self.assertEqual(
              np_input_array.real.dtype, output_array.real.dtype
          )
  
      if (
          not self.overwrite_input_flag in kwargs
          or not kwargs[self.overwrite_input_flag]
      ):
          self.assertTrue(numpy.allclose(input_array, orig_input_array))
  
      return output_array
  
imports: from pyfftw import interfaces, _supported_types, _all_types_np
  from .test_pyfftw_base import run_test_suites, np_fft
  from ._get_default_args import get_default_args
  from packaging.version import Version
  import unittest
  import numpy
  import warnings
  import copy
label_desc: Use image node_id 5 for calling the InterfacesNumpyFFTTestFFT obj's underlying member method code with example usage: obj._validate(array_type, test_shape, dtype, s, kwargs, copy_func) and returns: output_array