code: def set_mask(self, index, value):
      if not self._mask:
          self._mask = [ORIGIN] * len(self._words)
  
      if index > len(self.mask) - 1:
          raise ValueError(
              "Index {0} out of range {1}".format(
                  index, len(self.mask) - 1
              )
          )
      if value not in [ORIGIN, TASK_MASK, MODIFIED_MASK]:
          raise ValueError(
              "Support mask value in {0},  while input mask value is {1}!".format(
                  [ORIGIN, TASK_MASK, MODIFIED_MASK], value
              )
          )
      self._mask[index] = value
  
imports: from .cnsample import CnSample
  from ..field import ListField, Field
  from ....common.settings import ORIGIN, TASK_MASK, MODIFIED_MASK
label_desc: Use image node_id 6 for calling the DPCnTextField obj's underlying member method code with example usage: obj.set_mask(index, value) without return types