class_docstr: Base Sample class to hold the necessary info and provide atomic operations
class_docstr_tok: ["Base","Sample","class","to","hold","the","necessary","info","and","provide","atomic","operations"]
docstr: Swap items between first_index and second_index of field value.
  
  :param str field: field name
  :param int first_index:
  :param int second_index:
  :return: Modified Sample
docstr_tok: ["Swap","items","between","first_index","and","second_index","of","field","value",".",":","param","str","field",":","field","name",":","param","int","first_index",":",":","param","int","second_index",":",":","return",":","Modified","Sample"]
code: def swap_field_at_index(self, field, first_index, second_index):
      r"""
      Swap items between first_index and second_index of field value.
  
      :param str field: field name
      :param int first_index:
      :param int second_index:
      :return: Modified Sample
  
      """
      sample = self.clone(self)
  
      field_obj = getattr(sample, field)
      assert isinstance(field_obj, (ListField, TextField))
      rep_obj = field_obj.swap_at_index(first_index, second_index)
      setattr(sample, field, rep_obj)
  
      return sample
  
imports: import copy
  from abc import ABC, abstractmethod
  from ..field import ListField, TextField
  from ....common.settings import MODIFIED_MASK
  from ....common.preprocess.en_processor import EnProcessor
label_desc: Use image node_id 21 for calling the Sample obj's underlying member method code with example usage: obj.swap_field_at_index(field, first_index, second_index) and returns: sample