code: def inline_compress_chunk(chunk, level=1):
      
      b = cStringIO.StringIO()
      g = gzip.GzipFile(fileobj=b, mode='wb', compresslevel=level)
      g.write(chunk)
      g.close()
      cc = b.getvalue()
      b.close()
      return cc
docs: Compress a string using gzip.
  
      :type chunk: str
      :param chunk: The string to be compressed.
  
      :rtype: str
      :returns: `chunk` compressed.