code: def test_fromfunction(func, dtype, kwargs):
      a = np.fromfunction(func, shape=(5, 5), dtype=dtype, **kwargs)
      d = da.fromfunction(
          func, shape=(5, 5), chunks=(2, 2), dtype=dtype, **kwargs
      )
  
      assert_eq(d, a)
  
      d2 = da.fromfunction(
          func, shape=(5, 5), chunks=(2, 2), dtype=dtype, **kwargs
      )
  
      assert same_keys(d, d2)
  
imports: from __future__ import annotations
  import pytest
  import numpy
  import pytest
  from tlz import concat
  import dask
  import dask.array
  from dask.array.core import normalize_chunks
  from dask.array.numpy_compat import AxisError
  from dask.array.utils import assert_eq, same_keys
label_desc: Use image node_id 20 for calling a global function with example usage: test_fromfunction(func, dtype, kwargs) without return types