class_docstr: Base Chinese Sample class to hold the necessary info and provide atomic operations
class_docstr_tok: ["Base","Chinese","Sample","class","to","hold","the","necessary","info","and","provide","atomic","operations"]
docstr: Replace scope items of field value with rep_items which may
  not equal with scope.
  
  :param field: field str
  :param indices: list of int/tupe/list
  :param rep_items: list
  :return: Modified Sample
docstr_tok: ["Replace","scope","items","of","field","value","with","rep_items","which","may","not","equal","with","scope",".",":","param","field",":","field","str",":","param","indices",":","list","of","int\/tupe\/list",":","param","rep_items",":","list",":","return",":","Modified","Sample"]
code: def unequal_replace_field_at_indices(self, field, indices, rep_items):
      r"""
      Replace scope items of field value with rep_items which may
      not equal with scope.
  
      :param field: field str
      :param indices: list of int/tupe/list
      :param rep_items: list
      :return: Modified Sample
  
      """
      assert len(indices) == len(rep_items) > 0
      # for i in range(len(rep_items)):
      #     rep_items[i] = [k for k in rep_items[i]]
      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
              )
          else:
              sample = sample.insert_field_before_index(
                  field, insert_index, sorted_token
              )
  
      return sample
  
imports: import copy
  from abc import ABC, abstractmethod
  from textflint.input.component.field.list_field import ListField
  from ..field import CnTextField
  from ....common.settings import MODIFIED_MASK
  from ....common.preprocess.cn_processor import CnProcessor
label_desc: Use image node_id 16 for calling the CnSample obj's underlying member method code with example usage: obj.unequal_replace_field_at_indices(field, indices, rep_items) and returns: sample