code: def convolve(a, v, mode="full"):
      if a.ndim != 1 or v.ndim != 1:
          raise ValueError(
              "convolve() only support 1-dimensional inputs."
          )
      if a.shape[0] < v.shape[0]:
          a, v = v, a
      v = ivy.flip(v)
  
      out_order = slice(None)
  
      if mode == "valid":
          padding = [(0, 0)]
      elif mode == "same":
          padding = [
              (v.shape[0] // 2, v.shape[0] - v.shape[0] // 2 - 1)
          ]
      elif mode == "full":
          padding = [(v.shape[0] - 1, v.shape[0] - 1)]
  
      result = ivy.conv_general_dilated(
          a[None, None, :],
          v[:, None, None],
          (1,),
          padding,
          dims=1,
          data_format="channel_first",
      )
      return result[0, 0, out_order]
  
file_path: ivy/ivy/functional/frontends/numpy/mathematical_functions/miscellaneous.py
imports: import ivy
  from ivy.functional.frontends.numpy.func_wrapper import to_ivy_arrays_and_back, handle_numpy_casting, handle_numpy_dtype, from_zero_dim_arrays_to_scalar, handle_numpy_out
  from ivy.func_wrapper import with_supported_dtypes
label_desc: Use image node_id 13 for calling a global function with example usage: convolve(a, v, mode) and returns: result