code: def test_get_average_dist_to_tok_start_and_end():
      _DocSpan = collections.namedtuple("DocSpan", ["start", "length"])
  
      doc_span = _DocSpan(start=0, length=5)
  
      tok_start_position = 1
      tok_end_position = 3
  
      assert 2 == QADataset.get_average_dist_to_tok_start_and_end(
          doc_span, tok_start_position, tok_end_position
      )
  
      doc_span = _DocSpan(start=5, length=5)
  
      tok_start_position = 1
      tok_end_position = 2
  
      assert 6 == QADataset.get_average_dist_to_tok_start_and_end(
          doc_span, tok_start_position, tok_end_position
      )
  
      doc_span = _DocSpan(start=5, length=4)
  
      tok_start_position = 1
      tok_end_position = 2
  
      assert 5 == QADataset.get_average_dist_to_tok_start_and_end(
          doc_span, tok_start_position, tok_end_position
      )
  
file_path: NeMo/tests/collections/nlp/test_qna.py
imports: import collections
  import pytest
  import torch
  from nemo.collections.nlp.data.question_answering.dataset.qa_dataset import QADataset
  from nemo.collections.nlp.data.question_answering.dataset.qa_gpt_dataset import GPTQADataset
  from nemo.collections.nlp.metrics.qa_metrics import QAMetrics
label_desc: Use image node_id 9 for calling a global function with example usage: test_get_average_dist_to_tok_start_and_end() without return types