class_docstr: Creates a Dataset for GPT architecture based Generative QA 
class_docstr_tok: ["Creates","a","Dataset","for","GPT","architecture","based","Generative","QA"]
docstr: Calculates the maximum possible length for a given context given a question
      as inputs are 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","fixed","length","Divides","the","context","into","multiple","spans","based","on","the","calculated","max","length"]
code: def _prep_context(
      self,
      example,
      query_tokens_length,
      answer_tokens_length,
      context_prefix_tokens,
      answer_prefix_tokens,
  ):
      """
      Calculates the maximum possible length for a given context given a question
          as inputs are 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
          - query_tokens_length
          - answer_tokens_length
          - len(context_prefix_tokens)
          - len(answer_prefix_tokens)
          - 1  # -1 accounts for EOS token
      )
      context_spans = GPTQADataset.get_docspans(
          context_tokens, max_context_length, self.doc_stride
      )
      context_spans = tuple(context_spans)
  
      return context_tokens, context_spans
  
imports: import copy
  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_gpt_input_example import GPTQAInputExample
  from nemo.utils import logging
label_desc: Use image node_id 6 for calling the GPTQADataset obj's underlying member method code with example usage: obj._prep_context(example, query_tokens_length, answer_tokens_length, context_prefix_tokens, answer_prefix_tokens) and returns: context_tokens,  context_spans