def __init__(self, device, timeout=<NUM_LIT:1>, debug=False):
self.debug = debug<EOL>self.device = device<EOL>self.num_read_bytes = <NUM_LIT:0><EOL>self.num_write_bytes = <NUM_LIT:0><EOL>self.ser = None <EOL>self.ser = serial.serial_for_url(device)<EOL>self.ser.baudrate = <NUM_LIT><EOL>self.ser.timeout = timeout<EOL>if self.debug:<EOL><INDENT>sys.stderr.write("<STR_LIT>" %(<EOL>self.__class__.__name__,<EOL>self.ser<EOL>))<EOL><DEDENT>return None<EOL>
Open YHSM device.