def gold_query_string(self):
    """Generates a query string from the decoder actions for an example."""
    gold_query = list()
    for action in self.gold_sql_query.actions:
      if action.symbol:
        gold_query.append(action.symbol)
      elif action.entity_copy:
        copy_action = action.entity_copy
        if copy_action.copied_table:
          gold_query.append(copy_action.copied_table.original_table_name)
        else:
          gold_query.append(copy_action.copied_column.original_column_name)
      else:
        gold_query.append(action.utterance_copy.wordpiece)
    return ' '.join(gold_query)
Generates a query string from the decoder actions for an example.
language/xsp/data_preprocessing/nl_to_sql_example.py