code: def test_uses_named_inputs(self):
      inputs = {
          "question": "names",
          "table": "name\tdate\nmatt\t2017\npradeep\t2018",
      }
  
      archive_path = (
          self.FIXTURES_ROOT
          / "semantic_parsing"
          / "wikitables"
          / "serialization"
          / "model.tar.gz"
      )
      archive = load_archive(archive_path)
      predictor = Predictor.from_archive(archive, "wikitables-parser")
  
      result = predictor.predict_json(inputs)
  
      action_sequence = result.get("best_action_sequence")
      if action_sequence:
          # We don't currently disallow endless loops in the decoder, and an untrained seq2seq
          # model will easily get itself into a loop.  An endless loop isn't a finished logical
          # form, so decoding doesn't return any finished states, which means no actions.  So,
          # sadly, we don't have a great test here.  This is just testing that the predictor
          # runs, basically.
          assert len(action_sequence) > 1
          assert all(
              [
                  isinstance(action, unicode)
                  for action in action_sequence
              ]
          )
  
          logical_form = result.get("logical_form")
          assert logical_form is not None
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/predictors/wikitables_parser_test.py
imports: from __future__ import division
  from __future__ import absolute_import
  import os
  import pytest
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.models.archival import load_archive
  from allennlp.predictors import Predictor
  from allennlp.predictors.wikitables_parser import SEMPRE_ABBREVIATIONS_PATH, SEMPRE_GRAMMAR_PATH
label_desc: Use image node_id 3 for calling the TestWikiTablesParserPredictor obj's underlying member method code with example usage: obj.test_uses_named_inputs() without return types