code: def mean(
      x: Union[ivy.Array, ivy.NativeArray],
      /,
      *,
      axis: Optional[Union[int, Sequence[int]]] = None,
      keepdims: bool = False,
      out: Optional[ivy.Array] = None,
  ) -> ivy.Array:
      """Calculate the arithmetic mean of the input array ``x``.
  
      **Special Cases**
  
      Let ``N`` equal the number of elements over which to compute the arithmetic mean.
      -   If ``N`` is ``0``, the arithmetic mean is ``NaN``.
      -   If ``x_i`` is ``NaN``, the arithmetic mean is ``NaN`` (i.e., ``NaN`` values
          propagate).
  
      Parameters
      ----------
      x
          input array. Should have a floating-point data type.
      axis
          axis or axes along which arithmetic means must be computed. By default, the mean
          must be computed over the entire array. If a Sequence of integers, arithmetic
          means must be computed over multiple axes. Default: ``None``.
      keepdims
          bool, if ``True``, the reduced axes (dimensions) must be included in the result
          as singleton dimensions, and, accordingly, the result must be compatible with
          the input array (see :ref:`broadcasting`). Otherwise, if ``False``, the reduced
          axes (dimensions) must not be included in the result. Default: ``False``.
      out
          optional output array, for writing the result to.
  
      Returns
      -------
      ret
          array, if the arithmetic mean was computed over the entire array, a
          zero-dimensional array containing the arithmetic mean; otherwise, a
          non-zero-dimensional array containing the arithmetic means. The returned
          array must have the same data type as ``x``.
          .. note::
             While this specification recommends that this function only accept input
             arrays having a floating-point data type, specification-compliant array
             libraries may choose to accept input arrays having an integer data type.
             While mixed data type promotion is implementation-defined, if the input
             array ``x`` has an integer data type, the returned array must have the
             default floating-point data type.
  
  
      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/
      signatures.statistical_functions.mean.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.
  
      Examples
      --------
      With :class:`ivy.Array` input:
  
      >>> x = ivy.array([3., 4., 5.])
      >>> y = ivy.mean(x)
      >>> print(y)
      ivy.array(4.)
  
      >>> x = ivy.array([0., 1., 2.])
      >>> y = ivy.array(0.)
      >>> ivy.mean(x, out=y)
      >>> print(y)
      ivy.array(1.)
  
      >>> x = ivy.array([[-1., -2., -3., 0., -1.], [1., 2., 3., 0., 1.]])
      >>> y = ivy.array([0., 0.])
      >>> ivy.mean(x, axis=1, out=y)
      >>> print(y)
      ivy.array([-1.4,  1.4])
  
  
      With :class:`ivy.Container` input:
  
      >>> x = ivy.Container(a=ivy.array([-1., 0., 1.]), b=ivy.array([1.1, 0.2, 1.4]))
      >>> y = ivy.mean(x)
      >>> print(y)
      {
          a: ivy.array(0.),
          b: ivy.array(0.90000004)
      }
  
      >>> x = ivy.Container(a=ivy.array([[0., 1., 2.], [3., 4., 5.]]),
      ...                   b=ivy.array([[3., 4., 5.], [6., 7., 8.]]))
      >>> y = ivy.Container(a = ivy.zeros(3), b = ivy.zeros(3))
      >>> ivy.mean(x, axis=0, out=y)
      >>> print(y)
      {
          a: ivy.array([1.5, 2.5, 3.5]),
          b: ivy.array([4.5, 5.5, 6.5])
      }
      """
      return current_backend(x).mean(
          x, axis=axis, keepdims=keepdims, out=out
      )
  
file_path: ivy/ivy/functional/ivy/statistical.py
imports: from typing import Union, Optional, Sequence
  import ivy
  from ivy.utils.backend import current_backend
  from ivy.func_wrapper import handle_array_function, to_native_arrays_and_back, handle_out_argument, handle_nestable, handle_array_like_without_promotion, handle_device, handle_backend_invalid
  from ivy.utils.exceptions import handle_exceptions
label_desc: Use image node_id 4 for calling a global function with example usage: mean() and returns: current_backend