code: def top_k(
      x: Union[ivy.Array, ivy.NativeArray],
      k: int,
      /,
      *,
      axis: int = -1,
      largest: bool = True,
      sorted: bool = True,
      out: Optional[tuple] = None,
  ) -> Tuple[ivy.Array, ivy.NativeArray]:
      """Return the `k` largest elements of the given input array along a given
      axis.
  
      Parameters
      ----------
      x
          The array to compute top_k for.
      k
          Number of top elements to return must not exceed the array size.
      axis
          The axis along which we must return the top elements default value is 1.
      largest
          If largest is set to False we return k smallest elements of the array.
      sorted
          If sorted is set to True we return the elements in sorted order.
      out:
          Optional output tuple, for writing the result to. Must have two arrays inside,
          with a shape that the returned tuple broadcast to.
  
      Returns
      -------
      ret
          A named tuple with values and indices of top k elements.
  
      Examples
      --------
      With :class:`ivy.Array` input:
  
      >>> x = ivy.array([2., 1., -3., 5., 9., 0., -4])
      >>> y = ivy.top_k(x, 2)
      >>> print(y)
      top_k(values=ivy.array([9., 5.]), indices=ivy.array([4, 3]))
  
      >>> x = ivy.array([[-2., 3., 4., 0.], [-8., 0., -1., 2.]])
      >>> y = ivy.top_k(x, 2, axis=1, largest=False)
      >>> print(y)
      top_k(values=ivy.array([[-2.,  0.],
             [-8., -1.]]), indices=ivy.array([[0, 3],
             [0, 2]]))
  
      With :class:`ivy.NativeArray` input:
  
      >>> x = ivy.native_array([2., 1., -3., 5., 9., 0., -4])
      >>> y = ivy.top_k(x, 3)
      >>> print(y)
      top_k(values=ivy.array([9., 5., 2.]), indices=ivy.array([4, 3, 0]))
  
      With :class:`ivy.Container` input:
  
      >>> x = ivy.Container(a=ivy.array([-1, 2, -4]), b=ivy.array([4., 5., 0.]))
      >>> y = x.top_k(2)
      >>> print(y)
      [{
          a: ivy.array([2, -1]),
          b: ivy.array([5., 4.])
      }, {
          a: ivy.array([1, 0]),
          b: ivy.array([1, 0])
      }]
      """
      return current_backend(x).top_k(
          x, k, axis=axis, largest=largest, sorted=sorted, out=out
      )
  
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 11 for calling a global function with example usage: top_k() and returns: current_backend