code: def process_answers(
      answers, doc_offsets, passage_start_c, passage_start_t
  ):
      """TODO Write Comment"""
      answers_clear = []
      answers_tokenized = []
      for answer in answers:
          # This section calculates start and end relative to document
          answer_text = answer["text"]
          answer_len_c = len(answer_text)
          if "offset" in answer:
              answer_start_c = answer["offset"]
          else:
              answer_start_c = answer["answer_start"]
          answer_end_c = answer_start_c + answer_len_c - 1
          answer_start_t = offset_to_token_idx(
              doc_offsets, answer_start_c
          )
          answer_end_t = offset_to_token_idx(doc_offsets, answer_end_c)
  
          # TODO: Perform check that answer can be recovered from document?
  
          # This section converts start and end so that they are relative to the passage
          # TODO: Is this actually necessary on character level?
          answer_start_c -= passage_start_c
          answer_end_c -= passage_start_c
          answer_start_t -= passage_start_t
          answer_end_t -= passage_start_t
  
          curr_answer_clear = {
              "text": answer_text,
              "start_c": answer_start_c,
              "end_c": answer_end_c,
          }
          curr_answer_tokenized = {
              "start_t": answer_start_t,
              "end_t": answer_end_t,
              "answer_type": answer.get("answer_type", "span"),
          }
  
          answers_clear.append(curr_answer_clear)
          answers_tokenized.append(curr_answer_tokenized)
      return answers_clear, answers_tokenized
  
file_path: FARM/farm/data_handler/nq_utils.py
imports: import logging
  import re
  import numpy
  from farm.data_handler.samples import Sample
label_desc: Use image node_id 8 for calling a global function with example usage: process_answers(answers, doc_offsets, passage_start_c, passage_start_t) and returns: answers_clear,  answers_tokenized