code: def test_mean_shapes():
      a, w = get_data()
      out = mean(a)
      assert out.ndim == 0
      out = mean(a, w)
      assert out.ndim == 0
      out = mean(a, keepdims=True)
      assert out.shape == (1, 1, 1, 1)
      np.testing.assert_allclose(out.ravel()[0], mean(a), rtol=1e-07)
      out = mean(a, w, keepdims=True)
      assert out.shape == (1, 1, 1, 1)
      np.testing.assert_allclose(out.ravel()[0], mean(a, w), rtol=1e-07)
      out = mean(a, axis=1)
      assert out.shape == (3, 5, 6)
      out = mean(a, w, axis=1)
      assert out.shape == (3, 5, 6)
      out = mean(a, axis=(1, 2))
      assert out.shape == (3, 6)
      np.testing.assert_allclose(
          out, mean(a, np.ones_like(a), axis=(1, 2)), rtol=1e-07
      )
      out = mean(a, w, axis=(1, 2))
      assert out.shape == (3, 6)
      out = mean(a, axis=(1, 2), keepdims=True)
      assert out.shape == (3, 1, 1, 6)
      np.testing.assert_allclose(
          out.ravel(), mean(a, axis=(1, 2)).ravel(), rtol=1e-07
      )
      out = mean(a, w, axis=(1, 2), keepdims=True)
      assert out.shape == (3, 1, 1, 6)
      np.testing.assert_allclose(
          out.ravel(), mean(a, w, axis=(1, 2)).ravel(), rtol=1e-07
      )
  
file_path: popmon/tests/popmon/stats/test_numpy.py
imports: import itertools
  import numpy
  from scipy import linalg, stats
  from popmon.stats.numpy import mean, probability_distribution_mean_covariance, quantile, std
label_desc: Use image node_id 2 for calling a global function with example usage: test_mean_shapes() without return types