code: def test_loads_correct_dataset_reader(self):
      # This model has a different dataset reader configuration for train and validation. The
      # parameter that differs is the token indexer's namespace.
      archive = load_archive(
          self.FIXTURES_ROOT
          / "simple_tagger_with_span_f1"
          / "serialization"
          / "model.tar.gz"
      )
  
      predictor = Predictor.from_archive(archive, "sentence_tagger")
      assert (
          predictor._dataset_reader._token_indexers["tokens"].namespace
          == "test_tokens"
      )
  
      predictor = Predictor.from_archive(
          archive, "sentence_tagger", dataset_reader_to_load="train"
      )
      assert (
          predictor._dataset_reader._token_indexers["tokens"].namespace
          == "tokens"
      )
  
      predictor = Predictor.from_archive(
          archive,
          "sentence_tagger",
          dataset_reader_to_load="validation",
      )
      assert (
          predictor._dataset_reader._token_indexers["tokens"].namespace
          == "test_tokens"
      )
  
file_path: allennlp/tests/predictors/predictor_test.py
imports: from allennlp.common.testing import AllenNlpTestCase
  from allennlp.models.archival import load_archive
  from allennlp.predictors import Predictor
  from allennlp.nn import util
label_desc: Use image node_id 2 for calling the TestPredictor obj's underlying member method code with example usage: obj.test_loads_correct_dataset_reader() without return types