code: def diff(
      x: Union[ivy.Array, ivy.NativeArray, list, tuple],
      /,
      *,
      n: int = 1,
      axis: int = -1,
      prepend: Optional[
          Union[ivy.Array, ivy.NativeArray, int, list, tuple]
      ] = None,
      append: Optional[
          Union[ivy.Array, ivy.NativeArray, int, list, tuple]
      ] = None,
      out: Optional[ivy.Array] = None,
  ) -> ivy.Array:
      """Return the n-th discrete difference along the given axis.
  
      Parameters
      ----------
      x
          Array-like input.
      n
          The number of times values are differenced. If zero, the input is returned
          as-is.
      axis
          The axis along which the difference is taken, default is the last axis.
      prepend,append
          Values to prepend/append to x along given axis prior to performing the
          difference. Scalar values are expanded to arrays with length 1 in the direction
          of axis and the shape of the input array in along all other axes. Otherwise the
          dimension and shape must match x except along axis.
      out
          optional output array, for writing the result to.
  
      Returns
      -------
      ret
          Returns the n-th discrete difference along the given axis.
  
      Both the description and the type hints above assumes an array input for simplicity,
      but this function is *nestable*, and therefore also accepts :class:`ivy.Container`
      instances in place of any of the arguments.
  
      Examples
      --------
      >>> x = ivy.array([1, 2, 4, 7, 0])
      >>> ivy.diff(x)
      ivy.array([ 1,  2,  3, -7])
      """
      return ivy.current_backend().diff(
          x, n=n, axis=axis, prepend=prepend, append=append, out=out
      )
  
imports: from typing import Optional, Union, Tuple, List, Sequence
  from numbers import Number
  import ivy
  from ivy.func_wrapper import handle_out_argument, to_native_arrays_and_back, handle_nestable, handle_partial_mixed_function, handle_array_like_without_promotion, inputs_to_ivy_arrays, handle_array_function, infer_dtype, handle_device, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 13 for calling a global function with example usage: diff() and returns: ivy