class_docstr: Abstract base class for QA Datasets with common utility methods 
class_docstr_tok: ["Abstract","base","class","for","QA","Datasets","with","common","utility","methods"]
code: def get_doc_tokens_and_offset_from_context_id(
      context_id,
      start_position_character,
      is_impossible,
      answer_text,
      context_id_to_context_text,
  ):
      start_position, end_position = 0, 0
      context_text = context_id_to_context_text[context_id]
      doc_tokens, char_to_word_offset = QADataset.split_into_words(
          context_text
      )
  
      # Start end end positions only has a value during evaluation.
      if start_position_character is not None and not is_impossible:
          # start_position is index of word, end_position inclusive
          start_position = char_to_word_offset[start_position_character]
          end_position = char_to_word_offset[
              min(
                  start_position_character + len(answer_text) - 1,
                  len(char_to_word_offset) - 1,
              )
          ]
  
      return (
          doc_tokens,
          char_to_word_offset,
          start_position,
          end_position,
          context_text,
      )
  
imports: import collections
  import pickle
  from functools import lru_cache
  from typing import List
  import psutil
  import torch
  from nemo.collections.nlp.data.data_utils import is_whitespace
  from nemo.collections.nlp.data.question_answering.data_processor.qa_processing import EVALUATION_MODE, INFERENCE_MODE, TRAINING_MODE
  from nemo.core.classes import Dataset
  from nemo.utils import logging
label_desc: Use image node_id 13 for calling the QADataset obj's underlying member method code with example usage: obj.get_doc_tokens_and_offset_from_context_id(context_id, start_position_character, is_impossible, answer_text, context_id_to_context_text) and returns: doc_tokens,  char_to_word_offset,  start_position,  end_position,  context_text