'Mark an instance as deleted.
The database delete operation occurs upon ``flush()``.'

def delete(self, instance):

    if self._warn_on_events:
        self._flush_warning('Session.delete()')
    try:
        state = attributes.instance_state(instance)
    except exc.NO_STATE:
        raise exc.UnmappedInstanceError(instance)
    if (state.key is None):
        raise sa_exc.InvalidRequestError(("Instance    '%s'    is    not    persisted" % state_str(state)))
    if (state in self._deleted):
        return
    self._attach(state, include_before=True)
    cascade_states = list(state.manager.mapper.cascade_iterator('delete', state))
    self._deleted[state] = state.obj()
    self.identity_map.add(state)
    for (o, m, st_, dct_) in cascade_states:
        self._delete_impl(st_)
