'Place an object in the ``Session``.
Its state will be persisted to the database on the next flush
operation.
Repeated calls to ``add()`` will be ignored. The opposite of ``add()``
is ``expunge()``.'

def add(self, instance, _warn=True):

    if (_warn and self._warn_on_events):
        self._flush_warning('Session.add()')
    try:
        state = attributes.instance_state(instance)
    except exc.NO_STATE:
        raise exc.UnmappedInstanceError(instance)
    self._save_or_update_state(state)
