code: def test_generate_examples(self, parse_mock):
      xml_str = """
      <benchmark>
        <entries>
          <entry category="Building" eid="Id1" size="2">
            <originaltripleset>
              <otriple>103_Colmore_Row | architect | John_Madin</otriple>
              <otriple>103_Colmore_Row | location | "Colmore Row, Birmingham, England"@en</otriple>
            </originaltripleset>
            <modifiedtripleset>
              <mtriple>103_Colmore_Row | architect | John_Madin</mtriple>
              <mtriple>103_Colmore_Row | location | "Colmore Row, Birmingham, England"</mtriple>
            </modifiedtripleset>
            <lex comment="good" lid="Id1">Architect John Madin, designed 103 Colmore Row, located on Colmore Row, in Birmingham, England.</lex>
            <lex comment="good" lid="Id2">John Madin designed 103 Colmore Row, Birmingham, England.</lex>
          </entry>
          <entry category="Building" eid="Id2" size="2">
            <originaltripleset>
              <otriple>103_Colmore_Row | architect | John_Madin</otriple>
              <otriple>103_Colmore_Row | location | Colmore_Row</otriple>
            </originaltripleset>
            <modifiedtripleset>
              <mtriple>103_Colmore_Row | architect | John_Madin</mtriple>
              <mtriple>103_Colmore_Row | location | Colmore_Row</mtriple>
            </modifiedtripleset>
            <lex comment="good" lid="Id1">103 Colmore Row, located at Colmore Row, was designed by the architect, John Madin.</lex>
          </entry>
        </entries>
      </benchmark>
      """
      expected_examples = [
          {
              "input_text": {
                  "table": [
                      {
                          "column_header": "subject",
                          "row_number": 0,
                          "content": "103_Colmore_Row",
                      },
                      {
                          "column_header": "predicate",
                          "row_number": 0,
                          "content": "architect",
                      },
                      {
                          "column_header": "object",
                          "row_number": 0,
                          "content": "John_Madin",
                      },
                      {
                          "column_header": "subject",
                          "row_number": 1,
                          "content": "103_Colmore_Row",
                      },
                      {
                          "column_header": "predicate",
                          "row_number": 1,
                          "content": "location",
                      },
                      {
                          "column_header": "object",
                          "row_number": 1,
                          "content": '"Colmore Row, Birmingham, England"',
                      },
                  ],
                  "context": "Building",
              },
              "target_text": (
                  "Architect John Madin, designed 103 Colmore Row, located on "
                  "Colmore Row, in Birmingham, England."
              ),
          },
          {
              "input_text": {
                  "table": [
                      {
                          "column_header": "subject",
                          "row_number": 0,
                          "content": "103_Colmore_Row",
                      },
                      {
                          "column_header": "predicate",
                          "row_number": 0,
                          "content": "architect",
                      },
                      {
                          "column_header": "object",
                          "row_number": 0,
                          "content": "John_Madin",
                      },
                      {
                          "column_header": "subject",
                          "row_number": 1,
                          "content": "103_Colmore_Row",
                      },
                      {
                          "column_header": "predicate",
                          "row_number": 1,
                          "content": "location",
                      },
                      {
                          "column_header": "object",
                          "row_number": 1,
                          "content": '"Colmore Row, Birmingham, England"',
                      },
                  ],
                  "context": "Building",
              },
              "target_text": (
                  "John Madin designed 103 Colmore Row, Birmingham, England."
              ),
          },
          {
              "input_text": {
                  "table": [
                      {
                          "column_header": "subject",
                          "row_number": 0,
                          "content": "103_Colmore_Row",
                      },
                      {
                          "column_header": "predicate",
                          "row_number": 0,
                          "content": "architect",
                      },
                      {
                          "column_header": "object",
                          "row_number": 0,
                          "content": "John_Madin",
                      },
                      {
                          "column_header": "subject",
                          "row_number": 1,
                          "content": "103_Colmore_Row",
                      },
                      {
                          "column_header": "predicate",
                          "row_number": 1,
                          "content": "location",
                      },
                      {
                          "column_header": "object",
                          "row_number": 1,
                          "content": "Colmore_Row",
                      },
                  ],
                  "context": "Building",
              },
              "target_text": (
                  "103 Colmore Row, located at Colmore Row, was designed by the "
                  "architect, John Madin."
              ),
          },
      ]
      return_mock = mock.Mock()
      parse_mock.return_value = return_mock
      return_mock.getroot.return_value = etree.fromstring(xml_str)
      dataset = web_nlg.WebNlg()
      with mock.patch.object(tf, "io"):
          for i, (_, example) in enumerate(
              dataset._generate_examples([""], "train")
          ):
              self.assertCountEqual(example, expected_examples[i])
  
file_path: datasets/tensorflow_datasets/structured/web_nlg/web_nlg_test.py
imports: from unittest import mock
  import xml.etree.ElementTree
  import tensorflow
  import tensorflow_datasets.public_api
  from tensorflow_datasets.structured.web_nlg import web_nlg
label_desc: Use image node_id 1 for calling the WebNlgTest obj's underlying member method code with example usage: obj.test_generate_examples(parse_mock) without return types