code: def test_get_vocab_index_mapping(self):
      # pylint: disable=line-too-long
      mml_model_archive_file = (
          self.FIXTURES_ROOT
          / "semantic_parsing"
          / "nlvr_direct_semantic_parser"
          / "serialization"
          / "model.tar.gz"
      )
      archive = load_archive(mml_model_archive_file)
      mapping = self.model._get_vocab_index_mapping(archive.model.vocab)
      expected_mapping = [(i, i) for i in range(16)]
      assert mapping == expected_mapping
  
      new_vocab = Vocabulary()
  
      def copy_token_at_index(i):
          token = self.vocab.get_token_from_index(i, "tokens")
          new_vocab.add_token_to_namespace(token, "tokens")
  
      copy_token_at_index(5)
      copy_token_at_index(7)
      copy_token_at_index(10)
      mapping = self.model._get_vocab_index_mapping(new_vocab)
      # Mapping of indices from model vocabulary to new vocabulary. 0 and 1 are padding and unk
      # tokens.
      assert mapping == [(0, 0), (1, 1), (5, 2), (7, 3), (10, 4)]
  
imports: from __future__ import with_statement
  from __future__ import division
  from __future__ import absolute_import
  from numpy.testing import assert_almost_equal
  import torch
  from allennlp.common import Params
  from allennlp.common.testing import ModelTestCase
  from allennlp.data import Vocabulary
  from allennlp.data.iterators import EpochTrackingBucketIterator
  from allennlp.models import Model
  from allennlp.models.archival import load_archive
label_desc: Use image node_id 8 for calling the NlvrCoverageSemanticParserTest obj's underlying member method code with example usage: obj.test_get_vocab_index_mapping() without return types