code: def test_nonzero():
      data = np.arange(9).reshape((3, 3))
      mask = np.array(
          [
              [True, False, False],
              [True, True, False],
              [True, False, True],
          ]
      )
      a = np.ma.array(data, mask=mask)
      d_a = da.ma.masked_array(data=data, mask=mask, chunks=2)
  
      for c1, c2 in [
          (a > 4, d_a > 4),
          (a, d_a),
          (a <= -2, d_a <= -2),
          (a == 0, d_a == 0),
      ]:
          sol = np.ma.nonzero(c1)
          res = da.ma.nonzero(c2)
  
          assert isinstance(res, type(sol))
          assert len(res) == len(sol)
  
          for i in range(len(sol)):
              assert_eq(res[i], sol[i])
  
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 23 for calling a global function with example usage: test_nonzero() without return types