@decorator
def deflate(f, *args, **kwargs):

    data = f(*args, **kwargs)

    if isinstance(data, Response):
        content = data.data
    else:
        content = data

    deflater = zlib.compressobj()
    deflated_data = deflater.compress(content)
    deflated_data += deflater.flush()

    if isinstance(data, Response):
        data.data = deflated_data
        data.headers['Content-Encoding'] = 'deflate'
        data.headers['Content-Length'] = str(len(data.data))

        return data

    return deflated_data
Convert a Phillips Hue ID to ISY Address
dataset/ETHPy150Open mozillazg/bustard/tests/httpbin/filters.py/deflate--crossover with--dataset/ETHPy150Open UniversalDevicesInc/Polyglot/polyglot/node_servers/hue/converters.py/id_2_addr