class_docstr: Create mapping from BERT subtokens to their characters positions and vice versa.
  Args:
      do_lower_case: set True if lowercasing is needed
class_docstr_tok: ["Create","mapping","from","BERT","subtokens","to","their","characters","positions","and","vice","versa",".","Args",":","do_lower_case",":","set","True","if","lowercasing","is","needed"]
code: def __call__(
      self,
      contexts_batch,
      bert_features_batch,
      subtokens_batch,
      **kwargs,
  ):
      subtok2chars_batch: List[List[Dict[int, int]]] = []
      char2subtoks_batch: List[List[Dict[int, int]]] = []
  
      for batch_counter, (
          context_list,
          features_list,
          subtokens_list,
      ) in enumerate(
          zip(contexts_batch, bert_features_batch, subtokens_batch)
      ):
          subtok2chars_list, char2subtoks_list = [], []
          for context, features, subtokens in zip(
              context_list, features_list, subtokens_list
          ):
              if self.do_lower_case:
                  context = context.lower()
              context_start = subtokens.index("[SEP]") + 1
              idx = 0
              subtok2char: Dict[int, int] = {}
              char2subtok: Dict[int, int] = {}
              for i, subtok in list(enumerate(subtokens))[
                  context_start:-1
              ]:
                  subtok = (
                      subtok[2:] if subtok.startswith("##") else subtok
                  )
                  subtok_pos = context[idx:].find(subtok)
                  if subtok_pos == -1:
                      # it could be UNK
                      idx += 1  # len was at least one
                  else:
                      # print(k, '\t', t, p + idx)
                      idx += subtok_pos
                      subtok2char[i] = idx
                      for j in range(len(subtok)):
                          char2subtok[idx + j] = i
                      idx += len(subtok)
              subtok2chars_list.append(subtok2char)
              char2subtoks_list.append(char2subtok)
          subtok2chars_batch.append(subtok2chars_list)
          char2subtoks_batch.append(char2subtoks_list)
      return subtok2chars_batch, char2subtoks_batch
  
file_path: DeepPavlov/deeppavlov/models/preprocessors/squad_preprocessor.py
imports: import bisect
  from logging import getLogger
  from typing import List, Dict
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.models.component import Component
label_desc: Use image node_id 2 for calling the SquadBertMappingPreprocessor obj's underlying member method code with example usage: obj.__call__(contexts_batch, bert_features_batch, subtokens_batch) and returns: subtok2chars_batch,  char2subtoks_batch