code: def test_mask(self, test_data):
      # random mask
      masker = RandomKspaceMask(
          center_fractions=[0.08],
          accelerations=[4.0],
          spatial_dims=1,
          is_complex=True,
      )
      masker.set_random_state(seed=0)
      result, _ = masker(test_data)
      mask = masker.mask
      result = result[..., mask.squeeze() == 0, :].sum()
      self.assertEqual(result.item(), 0)
  
      # equispaced mask
      masker = EquispacedKspaceMask(
          center_fractions=[0.08],
          accelerations=[4.0],
          spatial_dims=1,
          is_complex=True,
      )
      masker.set_random_state(seed=0)
      result, _ = masker(test_data)
      mask = masker.mask
      result = result[..., mask.squeeze() == 0, :].sum()
      self.assertEqual(result.item(), 0)
  
file_path: MONAI/tests/test_kspace_mask.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from parameterized import parameterized
  from monai.apps.reconstruction.transforms.array import EquispacedKspaceMask, RandomKspaceMask
  from monai.utils.type_conversion import convert_data_type
label_desc: Use image node_id 1 for calling the TestMRIUtils obj's underlying member method code with example usage: obj.test_mask(test_data) without return types