code: def tril(
      x: Union[ivy.Array, ivy.NativeArray],
      /,
      *,
      k: int = 0,
      out: Optional[ivy.Array] = None,
  ) -> ivy.Array:
      """Return the lower triangular part of a matrix (or a stack of matrices)
      ``x``.
  
      .. note::
  
          The main diagonal is defined as the set of indices ``{(i, i)}`` for ``i``
          on the interval ``[0, min(M, N) - 1]``.
  
      Parameters
      ----------
      x
          input array having shape (..., M, N) and whose innermost two dimensions form MxN
          matrices.
      k
          diagonal above which to zero elements. If k = 0, the diagonal is the main
          diagonal. If k < 0, the diagonal is below the main diagonal. If k > 0, the
          diagonal is above the main diagonal. Default: ``0``.
      out
          optional output array, for writing the result to. It must have a shape that the
          inputs broadcast to.
  
      Returns
      -------
      ret
          an array containing the lower triangular part(s). The returned array must have
          the same shape and data type as x. All elements above the specified diagonal k
          must be zeroed. The returned array should be allocated on the same device as x.
  
  
      This function conforms to the `Array API Standard
      <https://data-apis.org/array-api/latest/>`_. This docstring is an extension of the
      `docstring <https://data-apis.org/array-api/latest/
      API_specification/generated/array_api.tril.html>`_
      in the standard.
  
      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.
      """
      return current_backend(x).tril(x, k=k, out=out)
  
imports: from __future__ import annotations
  import functools
  from numbers import Number
  from typing import Union, Tuple, Optional, List, Sequence, Callable, Protocol, TypeVar, Iterable
  import numpy
  import ivy
  from ivy import to_ivy
  from ivy.utils.exceptions import handle_exceptions
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import handle_array_function, infer_dtype, handle_out_argument, outputs_to_ivy_arrays, inputs_to_native_arrays, inputs_to_native_shapes, to_native_arrays_and_back, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_invalid, temp_asarray_wrapper
label_desc: Use image node_id 17 for calling a global function with example usage: tril() and returns: current_backend