def METHOD_NAME(self):
    program = AlazarProgram()
    begins, lengths = self.masks['sorted']
    with self.assertRaises(AssertionError):
        program.set_measurement_mask('foo', self.sample_factor, begins.astype(int), lengths)
    expected_unsorted = np.array([0, 1, 10]).astype(np.uint64), np.array([1, 8, 99]).astype(np.uint64)
    result = program.set_measurement_mask('unsorted', self.sample_factor, *self.masks['unsorted'])
    np.testing.assert_equal(program._masks, {'unsorted': expected_unsorted})
    np.testing.assert_equal(result, expected_unsorted)
    self.assertFalse(result[0].flags.writeable)
    self.assertFalse(result[1].flags.writeable)
    with self.assertRaisesRegex(RuntimeError, 'differing sample rate'):
        program.set_measurement_mask('sorted', self.sample_factor*5/4, *self.masks['sorted'])
    result = program.set_measurement_mask('sorted', self.sample_factor, *self.masks['sorted'])
    np.testing.assert_equal(result, self.expected['sorted'])