code: def test_count():
      data = np.arange(120).reshape((12, 10))
      mask = (data % 3 == 0) | (data % 4 == 0)
      x = np.ma.masked_where(mask, data)
      dx = da.from_array(x, chunks=(2, 3))
  
      for axis in (None, 0, 1):
          res = da.ma.count(dx, axis=axis)
          sol = np.ma.count(x, axis=axis)
          assert_eq(res, sol)
  
      res = da.ma.count(dx, keepdims=True)
      sol = np.ma.count(x, keepdims=True)
      assert_eq(res, sol)
  
      # Test all masked
      x = np.ma.masked_all((12, 10))
      dx = da.from_array(x, chunks=(2, 3))
      assert_eq(da.ma.count(dx), np.ma.count(x))
  
      # Test on non-masked array
      x = np.arange(120).reshape((12, 10))
      dx = da.from_array(data, chunks=(2, 3))
      for axis in (None, 0, 1):
          res = da.ma.count(dx, axis=axis)
          sol = np.ma.count(x, axis=axis)
          assert_eq(res, sol, check_dtype=sys.platform != "win32")
  
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 21 for calling a global function with example usage: test_count() without return types