code: def test_apply_gufunc_axes_02():
      def matmul(x, y):
          return np.einsum("...ij,...jk->...ik", x, y)
  
      rng = np.random.default_rng()
      a = rng.standard_normal((3, 2, 1))
      b = rng.standard_normal((3, 7, 5))
  
      da_ = da.from_array(a, chunks=2)
      db = da.from_array(b, chunks=3)
  
      m = np.einsum("jiu,juk->uik", a, b)
      dm = apply_gufunc(
          matmul,
          "(i,j),(j,k)->(i,k)",
          da_,
          db,
          axes=[(1, 0), (0, -1), (-2, -1)],
          allow_rechunk=True,
      )
      assert_eq(m, dm)
  
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 40 for calling a global function with example usage: test_apply_gufunc_axes_02() and returns: np