code: def interp(x, xp, fp, left=None, right=None):
      """
      cupy implementation of np.interp, falls back to cupy implementation
      if available.
      """
      x = cupy.asarray(x)
      xp = cupy.asarray(xp)
      fp = cupy.asarray(fp)
      if hasattr(cupy, "interp"):
          return cupy.interp(x, xp, fp, left, right)
      output_y = cupy.zeros(x.shape, dtype=cupy.float64)
      assert len(x.shape) == 2
      if left is None:
          left = fp[0]
      left = float(left)
      if right is None:
          right = fp[-1]
      right = float(right)
      interp2d_kernel[cuda_args(x.shape)](
          x.astype(cupy.float64),
          xp.astype(cupy.float64),
          fp.astype(cupy.float64),
          left,
          right,
          output_y,
      )
      return output_y
  
imports: from __future__ import annotations
  from math import ceil, isnan
  from packaging.version import Version
  import numba
  import numpy
  from numba import cuda
label_desc: Use image node_id 4 for calling a global function with example usage: interp(x, xp, fp, left, right) and returns: output_y, cupy