def _organize_states_for_delete(base_mapper, states, uowtransaction):
    states_to_delete = []

    for state, dict_, mapper, connection in _connections_for_states(
            base_mapper, uowtransaction,
            states):

        mapper.dispatch.before_delete(mapper, connection, state)

        states_to_delete.append((state, dict_, mapper,
                                 bool(state.key), connection))
    return states_to_delete
Test that circular references don't cause recursion errors.
dataset/ETHPy150Open RoseOu/flasky/venv/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py/_organize_states_for_delete--crossover with--dataset/ETHPy150Open mozilla/app-validator/tests/js/test_jstypes.py/test_jsarray_recursion