code: def test_moment():
      def moment(x, n, axis=None):
          return ((x - x.mean(axis=axis, keepdims=True)) ** n).sum(
              axis=axis
          ) / np.ones_like(x).sum(axis=axis)
  
      # Poorly conditioned
      x = np.array([1.0, 2.0, 3.0] * 10).reshape((3, 10)) + 1e8
      a = da.from_array(x, chunks=5)
      assert_eq(a.moment(2), moment(x, 2))
      assert_eq(a.moment(3), moment(x, 3))
      assert_eq(a.moment(4), moment(x, 4))
  
      x = np.arange(1, 122).reshape((11, 11)).astype("f8")
      a = da.from_array(x, chunks=(4, 4))
      assert_eq(a.moment(4, axis=1), moment(x, 4, axis=1))
      assert_eq(a.moment(4, axis=(1, 0)), moment(x, 4, axis=(1, 0)))
  
      # Tree reduction
      assert_eq(a.moment(order=4, split_every=4), moment(x, 4))
      assert_eq(
          a.moment(order=4, axis=0, split_every=4), moment(x, 4, axis=0)
      )
      assert_eq(
          a.moment(order=4, axis=1, split_every=4), moment(x, 4, axis=1)
      )
  
imports: from __future__ import annotations
  import os
  import warnings
  from contextlib import nullcontext
  from itertools import permutations, zip_longest
  import pytest
  import itertools
  import dask.array
  import dask.config
  from dask.array.numpy_compat import ComplexWarning, _numpy_122
  from dask.array.utils import assert_eq, same_keys
  from dask.core import get_deps
label_desc: Use image node_id 17 for calling a global function with example usage: test_moment() and returns: unknown