Sets the serial_number of this DeviceDataPostRequest.
        The serial number of the device.

        :param serial_number: The serial_number of this DeviceDataPostRequest.
        :type: str
979894
def serial_number(self, serial_number):
        
        if serial_number is not None and len(serial_number) > 64:
            raise ValueError("Invalid value for `serial_number`, length must be less than or equal to `64`")

        self._serial_number = serial_number
364818
def write(self, offset, value):
		
		if(not self.mode & 0b10):
			raise ReadOnlyError("Device is Read-Only")
		if(offset >= self.size):
			raise AddressError("Offset({}) not in address space({})".format(offset, self.size))
		self.repr_[offset].setvalue(value)
954242
def serial(self, may_block=True):
        
        if not self.capabilities.have_serial_number():
            raise yubikey_base.YubiKeyVersionError("Serial number unsupported in YubiKey %s" % self.version() )
        return self._read_serial(may_block)
1255295
def write(self, value):
        
        if self.mode is UNAVAILABLE:
            raise IOError("{0} can not be used through Firmata".format(self))
        if self.mode is INPUT:
            raise IOError("{0} is set up as an INPUT and can therefore not be written to"
                          .format(self))
        if value is not self.value:
            self.value = value
            if self.mode is OUTPUT:
                if self.port:
                    self.port.write()
                else:
                    msg = bytearray([DIGITAL_MESSAGE, self.pin_number, value])
                    self.board.sp.write(msg)
            elif self.mode is PWM:
                value = int(round(value * 255))
                msg = bytearray([ANALOG_MESSAGE + self.pin_number, value % 128, value >> 7])
                self.board.sp.write(msg)
            elif self.mode is SERVO:
                value = int(value)
                msg = bytearray([ANALOG_MESSAGE + self.pin_number, value % 128, value >> 7])
                self.board.sp.write(msg)
669280
def set_device_name(self, newname):
        
        return self.write(request.SetDeviceName(self.seq, *self.prep_str(newname)))
724646
def handle_rfx(sender, message):
    
    # Check for our target serial number and loop
    if message.serial_number == RF_DEVICE_SERIAL_NUMBER and message.loop[0] == True:
        print(message.serial_number, 'triggered loop #1')
62471
func (s *VirtualMFADevice) SetSerialNumber(v string) *VirtualMFADevice {
	s.SerialNumber = &v
	return s
}
1270752
async def i2c_write_request(self, command):
        
        device_address = int(command[0])
        params = command[1]
        params = [int(i) for i in params]
        await self.core.i2c_write_request(device_address, params)
806878
def parse_device_information(
        device_info_string: str) -> Mapping[str, str]:
    '''
        
    '''
    error_msg = 'Unexpected argument to parse_device_information: {}'.format(
        device_info_string)
    if not device_info_string or \
            not isinstance(device_info_string, str):
        raise ParseError(error_msg)
    parsed_values = device_info_string.strip().split(' ')
    if len(parsed_values) < 3:
        log.error(error_msg)
        raise ParseError(error_msg)
    res = {
        parse_key_from_substring(s): parse_string_value_from_substring(s)
        for s in parsed_values[:3]
    }
    for key in ['model', 'version', 'serial']:
        if key not in res:
            raise ParseError(error_msg)
    return res
736958
def write(self, pin, value):
        
        port, pin = self.pin_to_port(pin)
        portname = 'A'
        if port == 1:
            portname = 'B'
        self._update_register('GPIO' + portname, pin, value)
        self.sync()
1329788
def new(self):
        # type: () -> None
        '''
        
        '''
        if self._initialized:
            raise pycdlibexception.PyCdlibInternalError('UDF Terminating Descriptor already initialized')

        self.desc_tag = UDFTag()
        self.desc_tag.new(8)  # FIXME: we should let the user set serial_number

        self._initialized = True
289746
def add_device(self, model, serial):
        
        device = {
                'model': model,
                'vendor': self.vendor(),
                'sn': serial,
                'type': 'vendor'
        }
        headers = {
                'User-Agent': self.user_agent(),
        }
        headers.update(self.headers())

        r = requests.post(  self.portals_url()+'/portals/'+self.portal_id()+'/devices', 
                                data=json.dumps(device),
                                headers=headers,
                                auth=self.auth())

        if HTTP_STATUS.ADDED == r.status_code:
            # fix the 'meta' to be dictionary instead of string
            device_obj = r.json()
            return dictify_device_meta(device_obj)
        else:
            print("add_device: Something went wrong: <{0}>: {1}".format(
                        r.status_code, r.reason))
            r.raise_for_status()
70207
def serial_number():
    """"""
    sdata = {}
    if os.getuid() == 0:
        try:
            sdata['Serial'] = open('/sys/class/dmi/id/product_serial') \
                .read().strip()
        except:
            for line in os.popen('/usr/sbin/dmidecode -s system-serial-number'):
                sdata['Serial'] = line.strip()
    return sdata
484080
private static String getDeviceSerialNumber() {
        // We're using the Reflection API because Build.SERIAL is only available
        // since API Level 9 (Gingerbread, Android 2.3).
        try {
            return (String) Build.class.getField("SERIAL").get(null);
        } catch (Exception ignored) {
            return null;
        }
    }
123261
def deserialize(serial_data: dict) -> 'Response':
        

        r = Response(serial_data.get('id'))
        r.data.update(serial_data.get('data', {}))
        r.ended = serial_data.get('ended', False)
        r.failed = not serial_data.get('success', True)

        def load_messages(message_type: str):
            messages = [
                ResponseMessage(**data)
                for data in serial_data.get(message_type, [])
            ]
            setattr(r, message_type, getattr(r, message_type) + messages)

        load_messages('errors')
        load_messages('warnings')
        load_messages('messages')

        return r
688909
def respond(self, response_adu):
        
        log.debug('--> {0}'.format(hexlify(response_adu)))
        self.serial_port.write(response_adu)
657466
def set_number(self, key, value):
        
        storage = self.storage

        if not isinstance(value, int):
            logger.error("set_number: Value must be an integer")
            return

        try:
            lock.acquire()
            storage[key] = value
        finally:
            self.storage._p_changed = True
            lock.release()

        return storage[key]