code: def test_as_gufunc():
      x = da.random.default_rng().normal(size=(10, 5), chunks=(2, 5))
  
      @as_gufunc(
          "(i)->()",
          axis=-1,
          keepdims=False,
          output_dtypes=float,
          vectorize=True,
      )
      def foo(x):
          return np.mean(x, axis=-1)
  
      y = foo(x)
      valy = y.compute()
      assert isinstance(y, Array)
      assert valy.shape == (10,)
  
imports: from __future__ import annotations
  import numpy
  import pytest
  from numpy.testing import assert_equal
  import dask.array
  from dask.array.core import Array
  from dask.array.gufunc import _parse_gufunc_signature, _validate_normalize_axes, apply_gufunc, as_gufunc, gufunc
  from dask.array.utils import assert_eq
label_desc: Use image node_id 28 for calling a global function with example usage: test_as_gufunc() and returns: np