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: Fully replace multi fields at the same time and return new sample.
  Notice: Not suggest use this API as it will set mask values of TextField
  to MODIFIED_MASK.
  
  :param list fields: field str list
  :param list field_values: field value list
  :param list field_masks: indicate mask values, useful for printable text
  :return: Modified Sample
docstr_tok: ["Fully","replace","multi","fields","at","the","same","time","and","return","new","sample",".","Notice",":","Not","suggest","use","this","API","as","it","will","set","mask","values","of","TextField","to","MODIFIED_MASK",".",":","param","list","fields",":","field","str","list",":","param","list","field_values",":","field","value","list",":","param","list","field_masks",":","indicate","mask","values",",","useful","for","printable","text",":","return",":","Modified","Sample"]
code: def replace_fields(self, fields, field_values, field_masks=None):
      r"""
      Fully replace multi fields at the same time and return new sample.
      Notice: Not suggest use this API as it will set mask values of TextField
      to MODIFIED_MASK.
  
      :param list fields: field str list
      :param list field_values: field value list
      :param list field_masks: indicate mask values, useful for printable text
      :return: Modified Sample
  
      """
      assert len(fields) == len(field_values), (
          f"Fields length {len(fields)} unequal with "
          f"field values {len(field_values)}"
      )
      if field_masks:
          assert len(fields) == len(field_masks), (
              f"Fields length {len(fields)} unequal "
              f"with field masks {len(field_masks)}"
          )
  
      sample = self.clone(self)
  
      for index, field in enumerate(fields):
          origin_field = getattr(sample, field)
          assert isinstance(
              field_values[index], origin_field.field_type
          ), f"Cant replace {field} with type {field_values[index]}"
  
          new_field = origin_field.new_field(field_values[index])
          if isinstance(origin_field, TextField):
              masks_values = (
                  field_masks[index]
                  if field_masks
                  else [MODIFIED_MASK] * len(new_field)
              )
              new_field.replace_mask(masks_values)
  
          setattr(sample, field, new_field)
  
      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 10 for calling the Sample obj's underlying member method code with example usage: obj.replace_fields(fields, field_values, field_masks) and returns: sample