code: def tokenize(self, samples: Any):
      pad_on_right = self.tokenizer.padding_side == "right"
  
      samples["question"] = [q.lstrip() for q in samples["question"]]
  
      tokenized_samples = self.tokenizer(
          samples["question" if pad_on_right else "context"],
          samples["context" if pad_on_right else "question"],
          truncation="only_second" if pad_on_right else "only_first",
          max_length=self.max_source_length,
          stride=self.doc_stride,
          return_overflowing_tokens=True,
          return_offsets_mapping=True,
          padding=self.padding,
      )
  
      if "answer" in samples:
          (
              tokenized_samples,
              _sample_mapping,
              _offset_mapping,
          ) = self._prepare_train_features(
              self.tokenizer, samples, tokenized_samples, pad_on_right
          )
  
      if not self.model.training:
          if "answer" in samples:
              tokenized_samples[
                  "overflow_to_sample_mapping"
              ] = _sample_mapping
              tokenized_samples["offset_mapping"] = _offset_mapping
  
          # InputTransform function for eval or predict
          tokenized_samples = self._prepare_val_features(
              samples, tokenized_samples, pad_on_right
          )
  
          offset_mappings = tokenized_samples.pop("offset_mapping")
          example_ids = tokenized_samples.pop("example_id")
          contexts = tokenized_samples.pop("context")
  
          tokenized_samples[DataKeys.METADATA] = []
          for offset_mapping, example_id, context in zip(
              offset_mappings, example_ids, contexts
          ):
              tokenized_samples[DataKeys.METADATA].append(
                  {
                      "context": context,
                      "offset_mapping": offset_mapping,
                      "example_id": example_id,
                  }
              )
          if "answer" in tokenized_samples:
              answers = tokenized_samples.pop("answer")
              for index, answer in enumerate(answers):
                  tokenized_samples[DataKeys.METADATA][index][
                      "answer"
                  ] = answer
  
          del offset_mappings
          del example_ids
          del contexts
          del answers
  
      return tokenized_samples.data
  
file_path: lightning-flash/src/flash/text/question_answering/collate.py
imports: from dataclasses import dataclass
  from typing import Any, Optional, Union
  from flash.core.data.io.input import DataKeys
  from flash.core.integrations.transformers.collate import TransformersCollate
  from flash.core.model import Task
label_desc: Use image node_id 3 for calling the TextQuestionAnsweringCollate obj's underlying member method code with example usage: obj.tokenize(samples) and returns: tokenized_samples