code: def read_chunks(stm, size):
      
      if size == 0:
          yield b''
          return
  
      res = stm.recv(size)
      if len(res) == 0:
          raise ClosedConnectionError()
      yield res
      left = size - len(res)
      while left:
          buf = stm.recv(left)
          if len(buf) == 0:
              raise ClosedConnectionError()
          yield buf
          left -= len(buf)
docs: Reads exactly size bytes from stm and produces chunks
  
      May call stm.read multiple times until required
      number of bytes is read.
      If EOF is reached before size bytes are read
      will raise :class:`ClosedConnectionError`
  
      :param stm: Stream to read bytes from, should have read method,
                  this read method can return less than requested
                  number of bytes.
      :param size: Number of bytes to read.