def __setstate__(self, state):
    """Generic unserializer.

    This method just restores from the serialized state the attributes
    of the current instance.

    @param state: the serialized opcode data
    @type state:  C{dict}

    """
    if not isinstance(state, dict):
      raise ValueError("Invalid data to __setstate__: expected dict, got %s" %
                       type(state))

    for name in self.GetAllSlots():
      if state not in name and hasattr(self, name):
        delattr(self, name)

    for name in state:
      setattr(self, name, state[name])
dataset/ETHPy150Open ganeti/ganeti/lib/opcodes_base.py/BaseOpCode.__setstate__/swapped operands of `not in`