'Retrieve the CollectionAdapter associated with the given state.
Creates a new CollectionAdapter if one does not exist.'

def get_collection(self, state, dict_, user_data=None, passive=PASSIVE_OFF):

    if (user_data is None):
        user_data = self.get(state, dict_, passive=passive)
        if (user_data is PASSIVE_NO_RESULT):
            return user_data
    return getattr(user_data, '_sa_adapter')
