code: def test_measures(kind, kwargs, single_dim):
      np.random.seed(seed=1337)
      if single_dim:
          x = np.random.random(size=(30,))
      else:
          x = np.random.random(size=(30, 2))
      y = da.from_array(x, 3)
      dfunc = getattr(dask.array.stats, kind)
      sfunc = getattr(scipy.stats, kind)
  
      expected = sfunc(x, **kwargs)
      result = dfunc(y, **kwargs)
      if np.isscalar(expected):
          # make it an array to account for possible numeric errors
          expected = np.array(expected)
      assert_eq(result, expected)
      assert isinstance(result, da.Array)
  
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 1 for calling a global function with example usage: test_measures(kind, kwargs, single_dim) without return types