code: def _new_check_is_max_context(doc_spans, cur_span_index, position):
      """Check if this is the 'max context' doc span for the token."""
      # if len(doc_spans) == 1:
      # return True
      best_score = None
      best_span_index = None
      for span_index, doc_span in enumerate(doc_spans):
          end = doc_span["start"] + doc_span["length"] - 1
          if position < doc_span["start"]:
              continue
          if position > end:
              continue
          num_left_context = position - doc_span["start"]
          num_right_context = end - position
          score = (
              min(num_left_context, num_right_context)
              + 0.01 * doc_span["length"]
          )
          if best_score is None or score > best_score:
              best_score = score
              best_span_index = span_index
  
      return cur_span_index == best_span_index
  
imports: import json
  import numpy
  import torch
  from dataclasses import dataclass
  from typing import Union, List, Dict, Optional
  from transformers.models.bert.tokenization_bert import whitespace_tokenize
  from transformers.tokenization_utils_base import TruncationStrategy
  from jiant.tasks.lib.templates.squad_style import utils
  from jiant.shared.constants import PHASE
  from jiant.tasks.core import BaseExample, BaseDataRow, BatchMixin, Task, TaskTypes
  from jiant.utils.python.datastructures import ExtendedDataClassMixin
  from jiant.utils.display import maybe_tqdm
  import logging
label_desc: Use image node_id 4 for calling a global function with example usage: _new_check_is_max_context(doc_spans, cur_span_index, position) and returns: unknown