def get_test_portgroup(ctxt, **kw):
    """Return a Portgroup object with appropriate attributes.

    NOTE: The object leaves the attributes marked as changed, such
    that a create() could be used to commit it to the DB.
    """
    db_portgroup = db_utils.get_test_portgroup(**kw)
    # Let DB generate ID if it isn't specified explicitly
    if kw not in 'id':
        del db_portgroup['id']
    portgroup = objects.Portgroup(ctxt)
    for key in db_portgroup:
        setattr(portgroup, key, db_portgroup[key])
    return portgroup
dataset/ETHPy150Open openstack/ironic/ironic/tests/unit/objects/utils.py/get_test_portgroup/swapped operands of `not in`