code: def test_token_idx_bert_cased(self):
      sentence = "A, naïve [MASK] AllenNLP sentence."
      expected_tokens = [
          "[CLS]",
          "A",
          ",",
          "na",
          "##ï",
          "##ve",
          "[MASK]",
          "Allen",
          "##NL",
          "##P",
          "sentence",
          ".",
          "[SEP]",
      ]
      expected_idxs = [None, 0, 1, 3, 5, 6, 9, 16, 21, 23, 25, 33, None]
      tokenizer = PretrainedTransformerTokenizer("bert-base-cased")
      tokenized = tokenizer.tokenize(sentence)
      tokens = [t.text for t in tokenized]
      assert tokens == expected_tokens
      idxs = [t.idx for t in tokenized]
      assert idxs == expected_idxs
  
imports: from typing import Iterable, List
  import pytest
  from allennlp.common import Params
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data import Token
  from allennlp.data.tokenizers import PretrainedTransformerTokenizer
label_desc: Use image node_id 6 for calling the TestPretrainedTransformerTokenizer obj's underlying member method code with example usage: obj.test_token_idx_bert_cased() without return types