class_docstr: ABSASample Class
class_docstr_tok: ["ABSASample","Class"]
docstr: Insert items of multi given scopes before indices of field value
  at the same time.
  
  :param str field: transformed field
  :param list indices: indices of insert positions
  :param list items: insert items
  :return ~textflint.ABSAsample: modified sample
docstr_tok: ["Insert","items","of","multi","given","scopes","before","indices","of","field","value","at","the","same","time",".",":","param","str","field",":","transformed","field",":","param","list","indices",":","indices","of","insert","positions",":","param","list","items",":","insert","items",":","return","~textflint.ABSAsample",":","modified","sample"]
code: def insert_field_before_indices(self, field, indices, items):
      r"""
      Insert items of multi given scopes before indices of field value
      at the same time.
  
      :param str field: transformed field
      :param list indices: indices of insert positions
      :param list items: insert items
      :return ~textflint.ABSAsample: modified sample
  
      """
      new_items = items
      sample = self.clone(self)
  
      for i, index in enumerate(indices):
          if isinstance(items[i], list):
              offset = len(items[i])
          else:
              offset = len(ABSASample.text_processor.tokenize(items[i]))
  
          for term_id in sample.terms:
              if (
                  index
                  == sample.terms[term_id]["from"]
                  == sample.terms[term_id]["to"]
              ):
                  sample.terms[term_id]["to"] += offset
              elif index <= sample.terms[term_id]["from"]:
                  sample.terms[term_id]["from"] += offset
                  sample.terms[term_id]["to"] += offset
              elif index < sample.terms[term_id]["to"]:
                  sample.terms[term_id]["to"] += offset
  
              for opinion_word in sample.terms[term_id][
                  "opinion_position"
              ]:
                  if index == opinion_word[0] == opinion_word[1]:
                      opinion_word[1] += offset
                  elif index <= opinion_word[0]:
                      opinion_word[0] += offset
                      opinion_word[1] += offset
                  elif index < opinion_word[1]:
                      opinion_word[1] += offset
  
          sample = super(
              ABSASample, sample
          ).insert_field_before_indices(field, indices, new_items)
          sample.update_term_list(sample)
  
      return sample
  
imports: from .sample import Sample
  from ..field import TextField
  from ....common.utils.error import FlintError
label_desc: Use image node_id 11 for calling the ABSASample obj's underlying member method code with example usage: obj.insert_field_before_indices(field, indices, items) and returns: sample