(data, compresslevel=_COMPRESS_LEVEL_BEST, *, mtime=None)
return buf.getvalue()
Compress data in one shot and return the compressed string.
    Optional argument is the compression level, in range of 0-9.
Compress data in one shot and return the compressed string.
    Optional argument is the compression level, in range of 0-9.
Compress data in one shot and return the compressed string . Optional argument is the compression level in range of 0 - 9 .
def compress(data, compresslevel=_COMPRESS_LEVEL_BEST, *, mtime=None):
    """Compress data in one shot and return the compressed string.
    Optional argument is the compression level, in range of 0-9.
    """
    buf = io.BytesIO()
    with GzipFile(fileobj=buf, mode='wb', compresslevel=compresslevel, mtime=mtime) as f:
        f.write(data)
    return buf.getvalue()
def compress ( data , compresslevel = _COMPRESS_LEVEL_BEST , * , mtime = None ) : buf = io . BytesIO ( ) with GzipFile ( fileobj = buf , mode = 'wb' , compresslevel = compresslevel , mtime = mtime ) as f : f . write ( data ) return buf . getvalue ( )