class_docstr: Coref Sample
class_docstr_tok: ["Coref","Sample"]
docstr: Delete items of given scopes of field value.
  
  :param str field: transformed field
  :param list indices: indices of delete positions
  :return ~textflint.CorefSample: modified sample
docstr_tok: ["Delete","items","of","given","scopes","of","field","value",".",":","param","str","field",":","transformed","field",":","param","list","indices",":","indices","of","delete","positions",":","return","~textflint.CorefSample",":","modified","sample"]
code: def delete_field_at_indices(self, field, indices):
      r"""Delete items of given scopes of field value.
  
      :param str field: transformed field
      :param list indices: indices of delete positions
      :return ~textflint.CorefSample: modified sample
  
      """
      # arg type check
      assert field == "x"
      for span in indices:
          assert isinstance(span, (int, list, slice))
          if isinstance(span, list):
              assert len(span) == 2
          if isinstance(span, slice):
              assert span.start >= 0
              assert span.stop >= span.start
              assert span.step == 1 or span.step == None
  
      # arg convert
      indices_tmp = []
      for span in indices:
          if isinstance(span, int):
              indices_tmp.append(span)
          elif isinstance(span, list):
              indices_tmp.extend(range(span[0], span[1]))
          elif isinstance(span, slice):
              indices_tmp.extend(range(span.stop)[span])
  
      indices = sorted(list(set(indices_tmp)))
      # start
      sample = self.clone(self)
      # x
      field_obj = getattr(sample, "x")
      assert isinstance(field_obj, TextField)
      rep_obj = field_obj.delete_at_indices(indices)
      setattr(sample, "x", rep_obj)
      # doc_sp
      field_obj = getattr(sample, "doc_sp")
      assert isinstance(field_obj, TextField)
      rep_obj = field_obj.delete_at_indices(indices)
      setattr(sample, "doc_sp", rep_obj)
      # calc for item lengths (item_shifts)
      item_shifts = [-1] * len(indices)
      # calc for shift
      shifts = [
          shift_maker(idx, item_shift)
          for (idx, item_shift) in zip(indices, item_shifts)
      ]
      index_shift = shift_decor(shift_collector(shifts))
      # clusters, constituents, ner
  
      def preserve(span):
          return not span[0] in indices
  
      clusters = [
          [span for span in cluster if preserve(span)]
          for cluster in getattr(sample, "clusters").field_value
      ]
      constituents = [
          span
          for span in getattr(sample, "constituents").field_value
          if preserve(span)
      ]
      ner = [
          span
          for span in getattr(sample, "ner").field_value
          if preserve(span)
      ]
  
      setattr(
          sample, "clusters", ListField(recur_ap(index_shift, clusters))
      )
      setattr(
          sample,
          "constituents",
          ListField(recur_ap(index_shift, constituents)),
      )
      setattr(sample, "ner", ListField(recur_ap(index_shift, ner)))
  
      # sen_map
      sen_map = getattr(sample, "sen_map")
      for idx, item_shift in zip(indices, item_shifts):
          sen_idx = self.index_in_sen(idx)
          sen_map[sen_idx] += item_shift
      setattr(sample, "sen_map", sen_map)
  
      # sample + remove invalid cluster labels
      return CorefPartSample(
          sample.dump(with_check=False)
      ).remove_invalid_corefs_from_part()
  
imports: from ....common.settings import ORIGIN, TASK_MASK
  from ....common.utils.fp_utils import *
  from ....common.utils.shift_utils import *
  from .sample import Sample
  from ..field import ListField, TextField
label_desc: Use image node_id 16 for calling the CorefSample obj's underlying member method code with example usage: obj.delete_field_at_indices(field, indices) and returns: CorefPartSample, unknown