code: def test_tensordot():
      rng = da.random.default_rng()
      x = rng.random((2, 3, 4), chunks=(1, 2, 2))
      x[x < 0.4] = 0
      y = rng.random((4, 3, 2), chunks=(2, 2, 1))
      y[y < 0.4] = 0
  
      xx = da.ma.masked_equal(x, 0)
      yy = da.ma.masked_equal(y, 0)
  
      assert_eq(
          da.tensordot(x, y, axes=(2, 0)),
          da.ma.filled(da.tensordot(xx, yy, axes=(2, 0)), 0),
      )
      assert_eq(
          da.tensordot(x, y, axes=(1, 1)),
          da.ma.filled(da.tensordot(xx, yy, axes=(1, 1)), 0),
      )
      assert_eq(
          da.tensordot(x, y, axes=((1, 2), (1, 0))),
          da.ma.filled(da.tensordot(xx, yy, axes=((1, 2), (1, 0))), 0),
      )
  
imports: from __future__ import annotations
  import random
  import sys
  from copy import deepcopy
  from itertools import product
  import numpy
  import pytest
  import dask.array
  from dask.array.numpy_compat import ComplexWarning, _numpy_123
  from dask.array.utils import assert_eq
  from dask.base import tokenize
  from dask.utils import typename
label_desc: Use image node_id 5 for calling a global function with example usage: test_tensordot() without return types