code: def test_evaluate_works_with_vocab_expansion(self):
      archive_path = str(
          self.FIXTURES_ROOT
          / "basic_classifier"
          / "serialization"
          / "model.tar.gz"
      )
      # snli2 has a extra token ("seahorse") in it.
      evaluate_data_path = str(
          self.FIXTURES_ROOT
          / "data"
          / "text_classification_json"
          / "imdb_corpus2.jsonl"
      )
      embeddings_filename = str(
          self.FIXTURES_ROOT / "data" / "unawarded_embeddings.gz"
      )  # has only unawarded vector
      embedding_sources_mapping = json.dumps(
          {
              "_text_field_embedder.token_embedder_tokens": embeddings_filename
          }
      )
      kebab_args = [
          "evaluate",
          archive_path,
          evaluate_data_path,
          "--cuda-device",
          "-1",
      ]
  
      # TODO(mattg): the unawarded_embeddings.gz file above doesn't exist, but this test still
      # passes. This suggests that vocab extension in evaluate isn't currently doing anything,
      # and so it is broken.
  
      # Evaluate 1 with no vocab expansion,
      # Evaluate 2 with vocab expansion with no pretrained embedding file.
      # Evaluate 3 with vocab expansion with given pretrained embedding file.
      metrics_1 = evaluate_from_args(self.parser.parse_args(kebab_args))
      metrics_2 = evaluate_from_args(
          self.parser.parse_args(kebab_args + ["--extend-vocab"])
      )
      metrics_3 = evaluate_from_args(
          self.parser.parse_args(
              kebab_args
              + [
                  "--embedding-sources-mapping",
                  embedding_sources_mapping,
              ]
          )
      )
      assert metrics_1 != metrics_2
      assert metrics_2 != metrics_3
  
imports: import argparse
  import json
  from pathlib import Path
  from typing import Iterator, List, Dict
  from shutil import copyfile
  import pytest
  import torch
  from flaky import flaky
  from allennlp.commands.evaluate import evaluate_from_args, Evaluate
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data.data_loaders import TensorDict
  from allennlp.models import Model
label_desc: Use image node_id 5 for calling the TestEvaluate obj's underlying member method code with example usage: obj.test_evaluate_works_with_vocab_expansion() without return types