class_docstr: Creates a Dataset for T5/BART architecture based Generative QA 
class_docstr_tok: ["Creates","a","Dataset","for","T5\/BART","architecture","based","Generative","QA"]
docstr: Calculates the maximum possible length for a given context given a question
      as inputs are of fixed length
  Divides the context into multiple spans based on the calculated max length
docstr_tok: ["Calculates","the","maximum","possible","length","for","a","given","context","given","a","question","as","inputs","are","of","fixed","length","Divides","the","context","into","multiple","spans","based","on","the","calculated","max","length"]
code: def _prep_context(self, example, query_tokens, context_prefix_tokens):
      """
      Calculates the maximum possible length for a given context given a question
          as inputs are of fixed length
      Divides the context into multiple spans based on the calculated max length
      """
  
      context_tokens = self.tokenizer.tokenizer.tokenize(
          example.context_text
      )
      max_context_length = (
          self.max_seq_length
          - len(query_tokens)
          - len(context_prefix_tokens)
          - 1  # -1 accounts for </s> token in T5/BART
      )
      context_spans = S2SQADataset.get_docspans(
          context_tokens, max_context_length, self.doc_stride
      )
      context_spans = tuple(context_spans)
  
      return context_tokens, context_spans
  
file_path: NeMo/nemo/collections/nlp/data/question_answering/dataset/qa_s2s_dataset.py
imports: import os
  import numpy
  import torch
  from tqdm import trange
  from nemo.collections.nlp.data.question_answering.data_processor.qa_processing import INFERENCE_MODE, TRAINING_MODE
  from nemo.collections.nlp.data.question_answering.dataset.qa_dataset import QADataset
  from nemo.collections.nlp.data.question_answering.input_example.qa_s2s_input_example import S2SQAInputExample
  from nemo.utils import logging
label_desc: Use image node_id 5 for calling the S2SQADataset obj's underlying member method code with example usage: obj._prep_context(example, query_tokens, context_prefix_tokens) and returns: context_tokens,  context_spans