code: def test_setslices_hardmask(self):
      # Tests setting slices w/ hardmask.
      base = self.base.copy()
      mbase = base.view(mrecarray)
      mbase.harden_mask()
      try:
          mbase[-2:] = (5, 5, 5)
          assert_equal(mbase.a._data, [1, 2, 3, 5, 5])
          assert_equal(mbase.b._data, [1.1, 2.2, 3.3, 5, 5.5])
          assert_equal(
              mbase.c._data, [b"one", b"two", b"three", b"5", b"five"]
          )
          assert_equal(mbase.a._mask, [0, 1, 0, 0, 1])
          assert_equal(mbase.b._mask, mbase.a._mask)
          assert_equal(mbase.b._mask, mbase.c._mask)
      except NotImplementedError:
          # OK, not implemented yet...
          pass
      except AssertionError:
          raise
      else:
          raise Exception("Flexible hard masks should be supported !")
      # Not using a tuple should crash
      try:
          mbase[-2:] = 3
      except (NotImplementedError, TypeError):
          pass
      else:
          raise TypeError(
              "Should have expected a readable buffer object!"
          )
  
imports: import pickle
  import numpy
  import numpy.ma
  from numpy.ma import masked, nomask
  from numpy.testing import temppath
  from numpy._core.records import recarray, fromrecords, fromarrays
  from numpy.ma.mrecords import MaskedRecords, mrecarray, fromarrays, fromtextfile, fromrecords, addfield
  from numpy.ma.testutils import assert_, assert_equal, assert_equal_records
label_desc: Use image node_id 9 for calling the TestMRecords obj's underlying member method code with example usage: obj.test_setslices_hardmask() without return types