class_docstr: WSDSample Class
class_docstr_tok: ["WSDSample","Class"]
docstr: Get index list from indices
  :param list indices: a list of index varying in type(int,list,slice)
  :return: list idx_list:a list of index(int)
docstr_tok: ["Get","index","list","from","indices",":","param","list","indices",":","a","list","of","index","varying","in","type","(","int",",","list",",","slice",")",":","return",":","list","idx_list",":","a","list","of","index","(","int",")"]
code: def get_idx_list(self, indices):
      r"""
      Get index list from indices
      :param list indices: a list of index varying in type(int,list,slice)
      :return: list idx_list:a list of index(int)
      """
      idx_list = []
      # check validity
      for span in indices:
          assert isinstance(span, (int, list, slice))
          if isinstance(span, int):
              assert span >= 0, "invalid indices"
          if isinstance(span, list):
              assert len(span) == 2, "invalid indices"
          if 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"
      for span in indices:
          if isinstance(span, int):
              idx_list.append(span)
          elif isinstance(span, list):
              idx_list.extend(range(span[0], span[1]))
          elif isinstance(span, slice):
              idx_list.extend(range(span.stop)[span])
      # get all positions according to the mixed list
      idx_list = sorted(list(set(idx_list)))
      return idx_list
  
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 5 for calling the WSDSample obj's underlying member method code with example usage: obj.get_idx_list(indices) and returns: idx_list