code: def test_moments(k):
      x = np.random.random(size=(30, 2))
      y = da.from_array(x, 3)
  
      expected = scipy.stats.moment(x, k)
      result = dask.array.stats.moment(y, k)
      assert_eq(result, expected)
  
file_path: dask/dask/array/tests/test_stats.py
imports: from __future__ import annotations
  import warnings
  import pytest
  from packaging.version import parse
  import numpy
  import dask.array
  import dask.array.stats
  from dask.array.utils import allclose, assert_eq
  from dask.delayed import Delayed
label_desc: Use image node_id 5 for calling a global function with example usage: test_moments(k) without return types