code: def _default_fft_func(
      a, s=None, axes=None, plan=None, value_type="C2C"
  ):
      from cupy.cuda import cufft
  
      curr_plan = cufft.get_current_plan()
      if curr_plan is not None:
          if plan is None:
              plan = curr_plan
          else:
              raise RuntimeError(
                  "Use the cuFFT plan either as a context manager"
                  " or as an argument."
              )
  
      if isinstance(plan, cufft.PlanNd):  # a shortcut for using _fftn
          return _fftn
      elif (
          isinstance(plan, cufft.Plan1d)
          or a.ndim == 1
          or not config.enable_nd_planning
      ):
          return _fft
  
      # cuFFT's N-D C2R/R2C transforms may not agree with NumPy's outcomes
      if a.flags.f_contiguous and value_type != "C2C":
          return _fft
  
      _, axes_sorted = _prep_fftn_axes(a.ndim, s, axes, value_type)
      if len(axes_sorted) > 1 and _nd_plan_is_possible(
          axes_sorted, a.ndim
      ):
          # circumvent two potential hipFFT/rocFFT bugs as of ROCm 3.5.0
          # TODO(leofang): understand hipFFT better and test newer ROCm versions
          if cupy.cuda.runtime.is_hip:
              if (
                  0 == axes_sorted[0]
                  and len(axes_sorted) != a.ndim
                  and a.flags.c_contiguous
              ):
                  return _fft
  
              # For C2R, we don't use PlanNd; see the workaround in _exec_fft()
              if value_type == "C2R":
                  return _fft
  
          # prefer Plan1D in the 1D case
          return _fftn
      return _fft
  
imports: import functools
  import math
  import numpy
  import cupy
  from cupy.fft import config
  from cupy.fft._cache import get_plan_cache
label_desc: Use image node_id 14 for calling a global function with example usage: _default_fft_func(a, s, axes, plan, value_type) and returns: _fft, _fftn, _fft, _fftn, _fft, _fft, _fft