class_docstr: transform and retrieve features of RESample
docstr: insert word after given indices in sentence
  
  :param string field: field to be operated on
  :param list indices: a list of index to be inserted
  :param list new_item: list of items to be inserted
  
  :return dict: contains 'token', 'subj' ,'obj'  keys
docstr_tok: ["insert","word","after","given","indices","in","sentence",":","param","string","field",":","field","to","be","operated","on",":","param","list","indices",":","a","list","of","index","to","be","inserted",":","param","list","new_item",":","list","of","items","to","be","inserted",":","return","dict",":","contains","'token","'",",","'subj","'",",","'obj","'","keys"]
code: def insert_field_before_indices(self, field, indices, new_item):
      r"""
      insert word after given indices in sentence
  
      :param string field: field to be operated on
      :param list indices: a list of index to be inserted
      :param list new_item: list of items to be inserted
  
      :return dict: contains 'token', 'subj' ,'obj'  keys
  
      """
      sample = self.clone(self)
      text = self.data["x"]
  
      for i, item in enumerate(new_item):
          if type(item).__name__ == "list":
              new_item[i] = " ".join(item)
      for idx in indices:
          if idx >= len(text):
              print("index exceeds length")
              return sample
      sh, st = self.data["subj"][0], self.data["subj"][1]
      oh, ot = self.data["obj"][0], self.data["obj"][1]
      new_text, new_data = [], {}
      subj_before, obj_before = 0, 0
      for i, idx in enumerate(indices):
          if idx >= sh and idx <= st and st > sh:
              print("you should not change entity")
              return sample
          if idx >= oh and idx <= ot and ot > oh:
              print("you should not change entity")
              return sample
          if idx < sh:
              l = len(new_item[i].split(" "))
              subj_before += l
          if idx < oh:
              l = len(new_item[i].split(" "))
              obj_before += l
  
      for i in range(len(text)):
          if i in indices:
              idx = indices.index(i)
              to_insert = new_item[idx].split(" ")
              new_text += to_insert
          new_text.append(text[i])
  
      (
          new_data["x"],
          new_data["subj"],
          new_data["obj"],
          new_data["y"],
      ) = (
          new_text,
          [sh + subj_before, st + subj_before],
          [oh + obj_before, ot + obj_before],
          self.data["y"],
      )
      sample.load(new_data)
  
      return sample
  
imports: import random
  import copy
  from .sample import Sample
  from ..field import TextField
  from ....common.settings import TASK_MASK
label_desc: Use image node_id 13 for calling the RESample obj's underlying member method code with example usage: obj.insert_field_before_indices(field, indices, new_item) and returns: sample, sample, sample, sample