code: def read(self, num_bytes, debug_info=None):
          
          if self.debug:
              if not debug_info:
                  debug_info = str(num_bytes)
              sys.stderr.write("%s: READING %s\n" % (
                  self.__class__.__name__,
                  debug_info
              ))
          write_sock(self.socket_file, CMD_READ, num_bytes)
          res = read_sock(self.socket_file)
          if isinstance(res, Exception):
              raise res
  
          if self.debug:
              sys.stderr.write("%s: READ %i:\n%s\n" % (
                  self.__class__.__name__,
                  len(res),
                  pyhsm.util.hexdump(res)
              ))
          self.num_read_bytes += len(res)
          return res
docs: Read a number of bytes from YubiHSM device.