def __contains__(self, key):
        # Don't use hasattr() because hasattr() catches any exception, not only
        # AttributeError. We want to passthrough SQLAlchemy exceptions
        # (ex: sqlalchemy.orm.exc.DetachedInstanceError).
        try:
            getattr(self, key)
        except __HOLE__:
            return False
        else:
            return True
dataset/ETHPy150Open openstack/oslo.db/oslo_db/sqlalchemy/models.py/ModelBase.__contains__