class_docstr: A single QA candidate answer.
docstr: Set the answer string. This method will check that the answer given is valid given the start
  and end indices that are stored in the object. 
docstr_tok: ["Set","the","answer","string",".","This","method","will","check","that","the","answer","given","is","valid","given","the","start","and","end","indices","that","are","stored","in","the","object","."]
code: def _add_answer(self, string):
      """Set the answer string. This method will check that the answer given is valid given the start
      and end indices that are stored in the object."""
      if string == "":
          self.answer = "no_answer"
          if (
              self.offset_answer_start != 0
              or self.offset_answer_end != 0
          ):
              logger.error(
                  f"Both start and end offsets should be 0: \n"
                  f"{self.offset_answer_start}, {self.offset_answer_end} with a no_answer. "
              )
      else:
          self.answer = string
          if self.offset_answer_end - self.offset_answer_start <= 0:
              logger.error(
                  f"End offset comes before start offset: \n"
                  f"({self.offset_answer_start}, {self.offset_answer_end}) with a span answer. "
              )
          elif self.offset_answer_end <= 0:
              logger.error(
                  f"Invalid end offset: \n"
                  f"({self.offset_answer_start}, {self.offset_answer_end}) with a span answer. "
              )
  
imports: from typing import List, Any
  from abc import ABC
  import logging
label_desc: Use image node_id 4 for calling the QACandidate obj's underlying member method code with example usage: obj._add_answer(string) without return types