class_docstr: WSDSample Class
class_docstr_tok: ["WSDSample","Class"]
docstr: check validity of indices
  :param list indices: a list of index varying in type(int,list,slice)
  :param bool equal: default False, indicates whether the replacement is eaual
  :param list items:
docstr_tok: ["check","validity","of","indices",":","param","list","indices",":","a","list","of","index","varying","in","type","(","int",",","list",",","slice",")",":","param","bool","equal",":","default","False",",","indicates","whether","the","replacement","is","eaual",":","param","list","items",":"]
code: def check_indices_and_items(self, indices, items):
      r"""
      check validity of indices
      :param list indices: a list of index varying in type(int,list,slice)
      :param bool equal: default False, indicates whether the replacement is eaual
      :param list items:
      """
      assert len(indices) > 0, "indices should be not null!"
      assert len(indices) == len(items), "illegal insertion!"
      # check validity of index
      for span, word_list in zip(indices, items):
          assert (
              isinstance(span, int)
              or isinstance(span, list)
              or isinstance(span, slice)
          )
          if isinstance(span, int):
              assert span >= 0, "invalid indices"
          elif isinstance(span, list):
              assert len(span) == 2, "invalid indices"
          elif isinstance(span, slice):
              assert span.start >= 0, "invalid indices"
              assert span.stop >= span.start, "invalid indices"
              assert (
                  span.step == 1 or span.step is None
              ), "invalid indices"
          else:
              raise AssertionError
  
imports: from .sample import Sample
  from ..field import TextField, ListField
  import json
  from ....common.settings import TASK_MASK, PUNC
  import nltk
label_desc: Use image node_id 6 for calling the WSDSample obj's underlying member method code with example usage: obj.check_indices_and_items(indices, items) without return types