<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def build_ownership_map(table, key_from_row, value_from_row):
 """ Builds a dict mapping to lists of OwnershipPeriods, from a db table. """

    return _build_ownership_map_from_rows(
        sa.select(table.c).execute().fetchall(),
        key_from_row,
        value_from_row,
    )