def decode(binary):
    """Decode (gunzip) binary data."""
    encoded = io.BytesIO(binary)
    with gzip.GzipFile(mode='rb', fileobj=encoded) as file_:
        decoded = file_.read()
    return decoded
Decode (gunzip) binary data.