def _connections_for_states(base_mapper, uowtransaction, states):
    # if session has a connection callable,
    # organize individual states with the connection
    # to use for update
    if uowtransaction.session.connection_callable:
        connection_callable = \
            uowtransaction.session.connection_callable
    else:
        connection = uowtransaction.transaction.connection(base_mapper)
        connection_callable = None

    for state in _sort_states(states):
        if connection_callable:
            connection = connection_callable(base_mapper, state.obj())

        mapper = state.manager.mapper

        yield state, state.dict, mapper, connection
Computes the minimal polynomial of an algebraic element.
dataset/ETHPy150Open zzzeek/sqlalchemy/lib/sqlalchemy/orm/persistence.py/_connections_for_states--crossover with--dataset/ETHPy150Open sympy/sympy/sympy/polys/numberfields.py/minimal_polynomial