code: def _arg_peaks_as_expected(value):
      """Ensure argument `peaks` is a 1-D C-contiguous array of dtype('int64').
  
      Used in `peak_prominences` and `peak_widths` to make `peaks` compatible
      with the signature of the wrapped Cython functions.
  
      Returns
      -------
      value : ndarray
          A 1-D C-contiguous array with dtype('int64').
      """
      value = cupy.asarray(value)
      if value.size == 0:
          # Empty arrays default to cupy.float64 but are valid input
          value = cupy.array([], dtype=cupy.int64)
      try:
          # Safely convert to C-contiguous array of type cupy.int64
          value = value.astype(cupy.int64, order="C", copy=False)
      except TypeError as e:
          raise TypeError(
              "cannot safely cast `peaks` to dtype('intp')"
          ) from e
      if value.ndim != 1:
          raise ValueError("`peaks` must be a 1-D array")
      return value
  
imports: import math
  import cupy
  from cupy._core._scalar import get_typename
  from cupy_backends.cuda.api import runtime
  from cupyx import jit
label_desc: Use image node_id 10 for calling a global function with example usage: _arg_peaks_as_expected(value) and returns: value