def _find_direction(reverse):
    """Finds a column annotation in a given direction."""
    table_entities = _find_from_table(item, example, reverse=reverse)

    if not table_entities:
      return False

    for table_entity in table_entities:
      entity = _find_column_entities(item.value, example, table_entity)

      if entity:
        example.gold_sql_query.actions.append(
            SQLAction(entity_copy=SchemaEntityCopy(copied_column=entity)))
        return True

    raise ParseError('Unable to find annotation of table ' + str(item))
Finds a column annotation in a given direction.
language/xsp/data_preprocessing/sql_parsing.py