code: def test_accuracy_is_scored_correctly(self):
      # This is the first example in our test fixture.
      example_string = (
          '(example (id nt-0) (utterance "what was the last year where this team '
          'was a part of the usl a-league?") (context (graph '
          "tables.TableKnowledgeGraph tables/590.csv)) "
          '(targetValue (list (description "2004"))))'
      )
  
      # This logical form should produce the correct denotation (the "targetValue" above) given
      # the table.
      logical_form = (
          "((reverse fb:row.row.year) (fb:row.row.index (max "
          "((reverse fb:row.row.index) (fb:row.row.league fb:cell.usl_a_league)))))"
      )
      wikitables_accuracy = WikiTablesAccuracy(
          table_directory=unicode(
              self.FIXTURES_ROOT / "data" / "wikitables/"
          )
      )
      wikitables_accuracy(logical_form, example_string)
      assert wikitables_accuracy._count == 1
      assert wikitables_accuracy._correct == 1
  
      # Testing that we handle bad logical forms correctly.
      wikitables_accuracy(None, example_string)
      assert wikitables_accuracy._count == 2
      assert wikitables_accuracy._correct == 1
  
      wikitables_accuracy(
          "Error producing logical form", example_string
      )
      assert wikitables_accuracy._count == 3
      assert wikitables_accuracy._correct == 1
  
      # And an incorrect logical form.
      wikitables_accuracy(
          "(fb:row.row.league fb:cell.3rd_usl_3rd)", example_string
      )
      assert wikitables_accuracy._count == 4
      assert wikitables_accuracy._correct == 1
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/training/metrics/wikitables_accuracy_test.py
imports: from __future__ import division
  from __future__ import absolute_import
  import os
  import pytest
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.training.metrics import WikiTablesAccuracy
  from allennlp.training.metrics.wikitables_accuracy import SEMPRE_ABBREVIATIONS_PATH, SEMPRE_GRAMMAR_PATH
label_desc: Use image node_id 3 for calling the WikiTablesAccuracyTest obj's underlying member method code with example usage: obj.test_accuracy_is_scored_correctly() without return types