code: def mean(
      a, axis=None, dtype=None, out=None, keepdims=False, *, where=True
  ):
      axis = tuple(axis) if isinstance(axis, list) else axis
      dtype = (
          dtype or a.dtype
          if not ivy.is_int_dtype(a.dtype)
          else ivy.float64
      )
      where = ivy.where(where, ivy.ones_like(a), 0)
      if where is not True:
          a = ivy.where(where, a, 0.0)
          sum = ivy.sum(a, axis=axis, keepdims=keepdims, dtype=dtype)
          cnt = ivy.sum(where, axis=axis, keepdims=keepdims, dtype=int)
          ret = ivy.divide(sum, cnt, out=out)
      else:
          ret = ivy.mean(
              a.astype(dtype), axis=axis, keepdims=keepdims, out=out
          )
  
      return ret.astype(dtype)
  
file_path: ivy/ivy/functional/frontends/numpy/statistics/averages_and_variances.py
imports: import ivy
  from ivy.func_wrapper import with_unsupported_dtypes
  from ivy.functional.frontends.numpy.func_wrapper import to_ivy_arrays_and_back, handle_numpy_dtype, from_zero_dim_arrays_to_scalar, handle_numpy_out
label_desc: Use image node_id 3 for calling a global function with example usage: mean(a, axis, dtype, out, keepdims) and returns: ret