'Remove an item by value, consulting the keyfunc for the key.'

@collection.remover
@collection.internally_instrumented
def remove(self, value, _sa_initiator=None):

    key = self.keyfunc(value)
    if (self[key] != value):
        raise sa_exc.InvalidRequestError(("Can    not    remove    '%s':    collection    holds    '%s'    for    key    '%s'.    Possible    cause:    is    the    MappedCollection    key    function    based    on    mutable    properties    or    properties    that    only    obtain    values    after    flush?" % (value, self[key], key)))
    self.__delitem__(key, _sa_initiator)
