def read(self, num_bytes, debug_info=None):
if self.debug:<EOL><INDENT>if not debug_info:<EOL><INDENT>debug_info = str(num_bytes)<EOL><DEDENT>sys.stderr.write("<STR_LIT>" %(<EOL>self.__class__.__name__,<EOL>debug_info<EOL>))<EOL><DEDENT>res = self.ser.read(num_bytes)<EOL>if self.debug:<EOL><INDENT>sys.stderr.write("<STR_LIT>" %(<EOL>self.__class__.__name__,<EOL>len(res),<EOL>pyhsm.util.hexdump(res)<EOL>))<EOL><DEDENT>self.num_read_bytes += len(res)<EOL>return res<EOL>
Read a number of bytes from YubiHSM device.