code: def test_read_respects_max_dpd_tries_when_not_sorting(self):
      tables_directory = self.FIXTURES_ROOT / "data" / "wikitables"
      dpd_output_directory = (
          self.FIXTURES_ROOT / "data" / "wikitables" / "dpd_output"
      )
      reader = WikiTablesDatasetReader(
          lazy=False,
          sort_dpd_logical_forms=False,
          max_dpd_logical_forms=1,
          max_dpd_tries=1,
          tables_directory=tables_directory,
          dpd_output_directory=dpd_output_directory,
      )
      dataset = reader.read(
          unicode(
              self.FIXTURES_ROOT
              / "data"
              / "wikitables"
              / "sample_data.examples"
          )
      )
      instances = list(dataset)
      instance = instances[0]
      actions = [
          action_field.rule
          for action_field in instance.fields["actions"].field_list
      ]
  
      # We should have just taken the first logical form from the file, which has the following
      # action sequence.
      action_sequence = instance.fields[
          "target_action_sequences"
      ].field_list[0]
      action_indices = [
          l.sequence_index for l in action_sequence.field_list
      ]
      action_strings = [actions[i] for i in action_indices]
      assert action_strings == [
          "@start@ -> d",
          "d -> [<c,d>, c]",
          "<c,d> -> [<<#1,#2>,<#2,#1>>, <d,c>]",
          "<<#1,#2>,<#2,#1>> -> reverse",
          "<d,c> -> fb:cell.cell.date",
          "c -> [<r,c>, r]",
          "<r,c> -> [<<#1,#2>,<#2,#1>>, <c,r>]",
          "<<#1,#2>,<#2,#1>> -> reverse",
          "<c,r> -> fb:row.row.year",
          "r -> [<n,r>, n]",
          "<n,r> -> fb:row.row.index",
          "n -> [<nd,nd>, n]",
          "<nd,nd> -> max",
          "n -> [<r,n>, r]",
          "<r,n> -> [<<#1,#2>,<#2,#1>>, <n,r>]",
          "<<#1,#2>,<#2,#1>> -> reverse",
          "<n,r> -> fb:row.row.index",
          "r -> [<c,r>, c]",
          "<c,r> -> fb:row.row.league",
          "c -> fb:cell.usl_a_league",
      ]
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/data/dataset_readers/wikitables_test.py
imports: from __future__ import with_statement
  from __future__ import division
  from __future__ import absolute_import
  from allennlp.common import Params
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data.dataset_readers import WikiTablesDatasetReader
  from allennlp.semparse.worlds import WikiTablesWorld
  from io import open
label_desc: Use image node_id 3 for calling the WikiTablesDatasetReaderTest obj's underlying member method code with example usage: obj.test_read_respects_max_dpd_tries_when_not_sorting() without return types