code: def choose(
      arr: Union[ivy.Array, ivy.NativeArray],
      choices: Union[ivy.Array, ivy.NativeArray],
      /,
      *,
      out: None = None,
      mode: Union[str, None] = None,
  ) -> ivy.Array:
      """Take values from the input array by matching 1d index and data slices.
  
      Parameters
      ----------
      arr
          The source array.
      choices
          The indices of the values to extract.
      out
          The output array.
      mode
          One of: 'wrap', 'clip'. Parameter controlling how out-of-bounds indices
          will be handled.
  
      Returns
      -------
      ret
          The returned array has the same shape as `indices`.
  
      Examples
      --------
      >>> choices = ivy.array([[0, 1, 2, 3], [10, 11, 12, 13],
                          [20, 21, 22, 23], [30, 31, 32, 33]])
      >>> print(choose(ivy.array([2, 3, 1, 0]), choices))
      ivy.array([20, 31, 12, 3])
      >>> arr = ivy.array([2, 4, 1, 0])
      >>> print(choose(arr, choices, mode='clip')) # 4 goes to 3 (4-1)
      ivy.array([20, 31, 12, 3])
      >>> arr = ivy.array([2, 4, 1, 0])
      >>> print(choose(arr, choices, mode='wrap')) # 4 goes to (4 mod 4)
      ivy.array([20, 1, 12, 3])
      """
      return ivy.current_backend(arr).choose(
          arr, choices, out=out, mode=mode
      )
  
imports: from typing import Optional, Union, Tuple, Iterable, Sequence, Callable, Any, Literal, List
  from numbers import Number
  from functools import partial
  import math
  import ivy
  from ivy.func_wrapper import handle_out_argument, handle_partial_mixed_function, to_native_arrays_and_back, inputs_to_native_shapes, handle_nestable, handle_array_like_without_promotion, handle_view, inputs_to_ivy_arrays, handle_array_function, handle_device, handle_backend_invalid
  from ivy.functional.ivy.general import _numel
  from ivy.utils.backend import current_backend
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 56 for calling a global function with example usage: choose() and returns: ivy