def from_json(self, dictionary):
    """Converts from a JSON representation to a SQL action."""
    # Should only have one key -- any of the above keys.
    assert len(dictionary) == 1
    if 'symbol' in dictionary:
      self.symbol = dictionary['symbol']
      return self

    if 'entity_copy' in dictionary:
      self.entity_copy = SchemaEntityCopy().from_json(dictionary['entity_copy'])
      return self

    if 'utterance_copy' in dictionary:
      self.utterance_copy = Wordpiece().from_json(dictionary['utterance_copy'])
      return self
Converts from a JSON representation to a SQL action.
language/xsp/data_preprocessing/sql_utils.py