code: def test_reader_reads_grouped_data(self):
      test_file = unicode(
          self.FIXTURES_ROOT
          / "data"
          / "nlvr"
          / "sample_grouped_data.jsonl"
      )
      dataset = NlvrDatasetReader().read(test_file)
      instances = list(dataset)
      assert len(instances) == 2
      instance = instances[0]
      assert list(instance.fields.keys()) == set(
          [
              "sentence",
              "agenda",
              "worlds",
              "actions",
              "labels",
              "identifier",
          ]
      )
      sentence_tokens = instance.fields["sentence"].tokens
      expected_tokens = [
          "There",
          "is",
          "a",
          "circle",
          "closely",
          "touching",
          "a",
          "corner",
          "of",
          "a",
          "box",
          ".",
      ]
      assert [t.text for t in sentence_tokens] == expected_tokens
      actions = [
          action.rule
          for action in instance.fields["actions"].field_list
      ]
      assert len(actions) == 115
      agenda = [
          item.sequence_index
          for item in instance.fields["agenda"].field_list
      ]
      agenda_strings = [actions[rule_id] for rule_id in agenda]
      assert set(agenda_strings) == set(
          [
              "<o,o> -> circle",
              "<o,o> -> touch_corner",
              "<o,t> -> object_exists",
          ]
      )
      worlds = [
          world_field.as_tensor({})
          for world_field in instance.fields["worlds"].field_list
      ]
      assert all([isinstance(world, NlvrWorld) for world in worlds])
      labels = [
          label.label for label in instance.fields["labels"].field_list
      ]
      assert labels == ["true", "false", "true", "false"]
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/data/dataset_readers/nlvr_test.py
imports: from __future__ import division
  from __future__ import absolute_import
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data.dataset_readers import NlvrDatasetReader
  from allennlp.semparse.worlds import NlvrWorld
label_desc: Use image node_id 3 for calling the TestNlvrDatasetReader obj's underlying member method code with example usage: obj.test_reader_reads_grouped_data() without return types