def get_sparse_matrix_keys(session, key_table):
    """Return a list of keys for the sparse matrix."""
    return session.query(key_table).order_by(key_table.name).all()
Return a list of keys for the sparse matrix.