code: def test_atis_simple_action_sequence(
      self,
  ):  # pylint: disable=no-self-use
      world = AtisWorld(
          [
              (
                  "give me all flights from boston to "
                  "philadelphia next week arriving after lunch"
              )
          ]
      )
      action_sequence = world.get_action_sequence(
          (
              "(SELECT DISTINCT city . city_code , city . city_name "
              "FROM city WHERE ( city.city_name = 'BOSTON' ) );"
          )
      )
      assert action_sequence == [
          'statement -> [query, ";"]',
          'query -> ["(", "SELECT", distinct, select_results, "FROM", table_refs, '
          'where_clause, ")"]',
          'where_clause -> ["WHERE", "(", conditions, ")"]',
          "conditions -> [condition]",
          "condition -> [biexpr]",
          "biexpr -> [col_ref, binaryop, value]",
          "value -> [pos_value]",
          "pos_value -> [string]",
          "string -> [\"'BOSTON'\"]",
          'binaryop -> ["="]',
          'col_ref -> ["city", ".", "city_name"]',
          "table_refs -> [table_name]",
          'table_name -> ["city"]',
          "select_results -> [col_refs]",
          'col_refs -> [col_ref, ",", col_refs]',
          "col_refs -> [col_ref]",
          'col_ref -> ["city", ".", "city_name"]',
          'col_ref -> ["city", ".", "city_code"]',
          'distinct -> ["DISTINCT"]',
      ]
  
      action_sequence = world.get_action_sequence(
          (
              "( SELECT airport_service . airport_code "
              "FROM airport_service "
              "WHERE airport_service . city_code IN ( "
              "SELECT city . city_code FROM city "
              "WHERE city.city_name = 'BOSTON' ) ) ;"
          )
      )
  
      assert action_sequence == [
          'statement -> [query, ";"]',
          'query -> ["(", "SELECT", distinct, select_results, "FROM", table_refs, '
          'where_clause, ")"]',
          'where_clause -> ["WHERE", conditions]',
          "conditions -> [condition]",
          "condition -> [in_clause]",
          'in_clause -> [col_ref, "IN", query]',
          'query -> ["(", "SELECT", distinct, select_results, "FROM", table_refs, '
          'where_clause, ")"]',
          'where_clause -> ["WHERE", conditions]',
          "conditions -> [condition]",
          "condition -> [biexpr]",
          "biexpr -> [col_ref, binaryop, value]",
          "value -> [pos_value]",
          "pos_value -> [string]",
          "string -> [\"'BOSTON'\"]",
          'binaryop -> ["="]',
          'col_ref -> ["city", ".", "city_name"]',
          "table_refs -> [table_name]",
          'table_name -> ["city"]',
          "select_results -> [col_refs]",
          "col_refs -> [col_ref]",
          'col_ref -> ["city", ".", "city_code"]',
          'distinct -> [""]',
          'col_ref -> ["airport_service", ".", "city_code"]',
          "table_refs -> [table_name]",
          'table_name -> ["airport_service"]',
          "select_results -> [col_refs]",
          "col_refs -> [col_ref]",
          'col_ref -> ["airport_service", ".", "airport_code"]',
          'distinct -> [""]',
      ]
  
      action_sequence = world.get_action_sequence(
          (
              "( SELECT airport_service . airport_code "
              "FROM airport_service WHERE airport_service . city_code IN "
              "( SELECT city . city_code FROM city "
              "WHERE city.city_name = 'BOSTON' ) AND 1 = 1) ;"
          )
      )
  
      assert action_sequence == [
          'statement -> [query, ";"]',
          'query -> ["(", "SELECT", distinct, select_results, "FROM", table_refs, '
          'where_clause, ")"]',
          'where_clause -> ["WHERE", conditions]',
          "conditions -> [condition, conj, conditions]",
          "conditions -> [condition]",
          "condition -> [biexpr]",
          "biexpr -> [value, binaryop, value]",
          "value -> [pos_value]",
          "pos_value -> [number]",
          'number -> ["1"]',
          'binaryop -> ["="]',
          "value -> [pos_value]",
          "pos_value -> [number]",
          'number -> ["1"]',
          'conj -> ["AND"]',
          "condition -> [in_clause]",
          'in_clause -> [col_ref, "IN", query]',
          'query -> ["(", "SELECT", distinct, select_results, "FROM", table_refs, '
          'where_clause, ")"]',
          'where_clause -> ["WHERE", conditions]',
          "conditions -> [condition]",
          "condition -> [biexpr]",
          "biexpr -> [col_ref, binaryop, value]",
          "value -> [pos_value]",
          "pos_value -> [string]",
          "string -> [\"'BOSTON'\"]",
          'binaryop -> ["="]',
          'col_ref -> ["city", ".", "city_name"]',
          "table_refs -> [table_name]",
          'table_name -> ["city"]',
          "select_results -> [col_refs]",
          "col_refs -> [col_ref]",
          'col_ref -> ["city", ".", "city_code"]',
          'distinct -> [""]',
          'col_ref -> ["airport_service", ".", "city_code"]',
          "table_refs -> [table_name]",
          'table_name -> ["airport_service"]',
          "select_results -> [col_refs]",
          "col_refs -> [col_ref]",
          'col_ref -> ["airport_service", ".", "airport_code"]',
          'distinct -> [""]',
      ]
  
      world = AtisWorld(
          [
              (
                  "give me all flights from boston to "
                  "philadelphia next week arriving after lunch"
              )
          ]
      )
      action_sequence = world.get_action_sequence(
          (
              "( SELECT DISTINCT flight.flight_id "
              "FROM flight WHERE "
              "( flight . from_airport IN "
              "( SELECT airport_service . airport_code "
              "FROM airport_service WHERE airport_service . city_code IN "
              "( SELECT city . city_code "
              "FROM city "
              "WHERE city.city_name = 'BOSTON' )))) ;"
          )
      )
  
      assert action_sequence == [
          'statement -> [query, ";"]',
          'query -> ["(", "SELECT", distinct, select_results, "FROM", table_refs, '
          'where_clause, ")"]',
          'where_clause -> ["WHERE", "(", conditions, ")"]',
          "conditions -> [condition]",
          "condition -> [in_clause]",
          'in_clause -> [col_ref, "IN", query]',
          'query -> ["(", "SELECT", distinct, select_results, "FROM", table_refs, '
          'where_clause, ")"]',
          'where_clause -> ["WHERE", conditions]',
          "conditions -> [condition]",
          "condition -> [in_clause]",
          'in_clause -> [col_ref, "IN", query]',
          'query -> ["(", "SELECT", distinct, select_results, "FROM", table_refs, '
          'where_clause, ")"]',
          'where_clause -> ["WHERE", conditions]',
          "conditions -> [condition]",
          "condition -> [biexpr]",
          "biexpr -> [col_ref, binaryop, value]",
          "value -> [pos_value]",
          "pos_value -> [string]",
          "string -> [\"'BOSTON'\"]",
          'binaryop -> ["="]',
          'col_ref -> ["city", ".", "city_name"]',
          "table_refs -> [table_name]",
          'table_name -> ["city"]',
          "select_results -> [col_refs]",
          "col_refs -> [col_ref]",
          'col_ref -> ["city", ".", "city_code"]',
          'distinct -> [""]',
          'col_ref -> ["airport_service", ".", "city_code"]',
          "table_refs -> [table_name]",
          'table_name -> ["airport_service"]',
          "select_results -> [col_refs]",
          "col_refs -> [col_ref]",
          'col_ref -> ["airport_service", ".", "airport_code"]',
          'distinct -> [""]',
          'col_ref -> ["flight", ".", "from_airport"]',
          "table_refs -> [table_name]",
          'table_name -> ["flight"]',
          "select_results -> [col_refs]",
          "col_refs -> [col_ref]",
          'col_ref -> ["flight", ".", "flight_id"]',
          'distinct -> ["DISTINCT"]',
      ]
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/semparse/worlds/atis_world_test.py
imports: from __future__ import division
  from __future__ import absolute_import
  import json
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.semparse.worlds.atis_world import AtisWorld
  from io import open
label_desc: Use image node_id 4 for calling the TestAtisWorld obj's underlying member method code with example usage: obj.test_atis_simple_action_sequence() without return types