human
Complete this python program:
def listens_for(target, identifier, *args, **kw):
assistant
#Here is the Python program you requested.

    """Decorate a function as a listener for the given target + identifier.
    e.g.::
    from sqlalchemy import event
    from sqlalchemy.schema import UniqueConstraint
    @event.listens_for(UniqueConstraint, "after_parent_attach")
    def unique_constraint_name(const, table):
    const.name = "uq_%s_%s" % (
    table.name,
    list(const.columns)[0].name
    A given function can also be invoked for only the first invocation
    of the event using the ``once`` argument::
    @event.listens_for(Mapper, "before_configure", once=True)
    def on_config():
    do_config()
    .. versionadded:: 0.9.3 Added ``once=True`` to :func:`.event.listen`
    and :func:`.event.listens_for`.
    """
    def decorate(fn):
        listen(target, identifier, fn, *args, **kw)
        return fn
    return decorate