@staticmethod<EOL><INDENT>def as_from(value):<DEDENT>
keys = ['<STR_LIT:port>','<STR_LIT>','<STR_LIT>','<STR_LIT>','<STR_LIT>','<STR_LIT>']<EOL>values = value.replace('<STR_LIT:U+002C>', '<STR_LIT::>').split('<STR_LIT::>')<EOL>if len(values) == <NUM_LIT:5>:<EOL><INDENT>values.append(RTSCTS)<EOL><DEDENT>if len(keys) != len(values):<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>' % (<EOL>value,))<EOL><DEDENT>kwargs = dict(zip(keys, values))<EOL>kwargs['<STR_LIT>'] = int(kwargs['<STR_LIT>'])<EOL>kwargs['<STR_LIT>'] = int(kwargs['<STR_LIT>'])<EOL>kwargs['<STR_LIT>'] = int(kwargs['<STR_LIT>'])<EOL>return SerialSettings(**kwargs)<EOL>
Constructs an instance of :class:`SerialSettings` from a string
representation, that looks like ``/dev/ttyS0:9600,8,1,N,RTSCTS``,
describing, in order, the serial port name, baud rate, byte size,
stop bits, parity and flow control protocol.

Valid string representations are (in cases where protocol is not
specified, RTS/CTS is assumed)::

    COM1:115000,8,1,E
    COM1:115000:8:1:E
    COM4:9600:8:2:O:DSRDTR
    /dev/ttyS0:9600,8,1,N,RTSCTS
    /dev/ttyS0,9600,8,1,N