class_docstr: POS Sample class to hold the necessary info and provide atomic operations.
docstr: See sample.py for details.
docstr_tok: ["See","sample.py","for","details","."]
code: def unequal_replace_field_at_indices(self, field, indices, rep_items):
      r"""
      See sample.py for details.
  
      """
      assert len(indices) == len(rep_items) > 0
      sample = self.clone(self)
      sorted_items, sorted_indices = zip(
          *sorted(
              zip(rep_items, indices), key=lambda x: x[1], reverse=True
          )
      )
  
      for idx, sorted_token in enumerate(sorted_items):
          sample = sample.delete_field_at_index(
              field, sorted_indices[idx]
          )
          insert_index = (
              sorted_indices[idx]
              if isinstance(sorted_indices[idx], int)
              else sorted_indices[idx][0]
          )
          field_obj = getattr(sample, field)
          if insert_index > len(field_obj):
              raise ValueError(
                  "Cant replace items at range {0}".format(
                      sorted_indices[idx]
                  )
              )
          elif insert_index == len(field_obj):
              sample = sample.insert_field_after_index(
                  field, insert_index - 1, sorted_token.split()
              )
          else:
              sample = sample.insert_field_before_index(
                  field, insert_index, sorted_token.split()
              )
  
      return sample
  
file_path: textflint/textflint/input/component/sample/pos_sample.py
imports: from .sample import Sample
  from ..field import ListField, TextField
label_desc: Use image node_id 9 for calling the POSSample obj's underlying member method code with example usage: obj.unequal_replace_field_at_indices(field, indices, rep_items) and returns: sample