code: def _optimal_oa_block_size(overlap):
      """
      Computes the optimal block size for the OA method given the overlap size.
  
      Computed as ``ceil(-overlap*W(-1/(2*e*overlap)))`` where ``W(z)`` is the
      Lambert W function solved as per ``scipy.special.lambertw(z, -1)`` with a
      fixed 4 iterations.
  
      Returned size should still be given to ``cupyx.scipy.fft.next_fast_len()``.
      """
  
      # This function is 10x faster in Cython (but only 1.7us in Python). Can be
      # easily moved to Cython by:
      #  * adding `DEF` before `__EXP_N1`
      #  * changing `import math` to `from libc cimport math`
      #  * adding `@cython.cdivision(True)` before the function
      #  * adding `Py_ssize_t` as the type for the `overlap` argument
      #  * adding a cast `<Py_ssize_t>` or `int(...)` to the return value
      #  * adding the following type declarations:
      #      cdef double z, w, ew, wew, wewz
      #      cdef int i
  
      # Compute W(-1/(2*e*overlap))
      z = -__EXP_N1 / (2 * overlap)  # value to compute for
      w = -1 - math.log(2 * overlap)  # initial guess
      for i in range(4):
          ew = math.exp(w)
          wew = w * ew
          wewz = wew - z
          w -= wewz / (wew + ew - (w + 2) * wewz / (2 * w + 2))
      return math.ceil(-overlap * w)
  
file_path: cupy/cupyx/scipy/signal/_signaltools_core.py
imports: import math
  import cupy
  from cupy._core import internal
  from cupyx.scipy import fft
  from cupyx.scipy.ndimage import _filters
  from cupyx.scipy.ndimage import _util
label_desc: Use image node_id 9 for calling a global function with example usage: _optimal_oa_block_size(overlap) and returns: math