code: def _check_is_max_context(doc_spans, cur_span_index, position):
      """Check if this is the 'max context' doc span for the token."""
      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 os
  from functools import partial
  from multiprocessing import Pool, cpu_count
  import numpy
  from tqdm import tqdm
  from ...models.bert.tokenization_bert import whitespace_tokenize
  from ...tokenization_utils_base import BatchEncoding, PreTrainedTokenizerBase, TruncationStrategy
  from ...utils import is_tf_available, is_torch_available, logging
  from .utils import DataProcessor
label_desc: Use image node_id 2 for calling a global function with example usage: _check_is_max_context(doc_spans, cur_span_index, position) and returns: unknown