code: def build_ownership_map(table, key_from_row, value_from_row):
      
      return _build_ownership_map_from_rows(
          sa.select(table.c).execute().fetchall(),
          key_from_row,
          value_from_row,
      )
docs: Builds a dict mapping to lists of OwnershipPeriods, from a db table.