code: def gen_chunks(self, gen):
          
          for data in gen:
              size = len(data)
              if size < self.chunk_size:
                  yield data
              else:
                  mv = buffer(data)
                  offset = 0
                  while offset < size:
                      nb = min(self.chunk_size, size - offset)
                      yield mv[offset:offset + nb]
                      offset += nb
docs: Generates byte chunks of a given size.
  
          Takes a bytes generator and yields chunks of a maximum of
          ``chunk_size`` bytes.
  
          Parameters
          ----------
          gen : generator
              The bytes generator that produces the bytes