'Sets the device being operated on.'

@_validator
def device(self, device):

    if isinstance(device, Device):
        self.arch = (device.arch or self.arch)
        self.bits = (device.bits or self.bits)
        self.endian = (device.endian or self.endian)
        self.os = (device.os or self.os)
    elif isinstance(device, str):
        device = Device(device)
    elif (device is not None):
        raise AttributeError('device    must    be    either    a    Device    object    or    a    serial    number    as    a    string')
    return device
