def gzip(self, data, truncate=True):
        # Entropy is a simple ratio of: <zlib compressed size> / <original size>
        e = float(float(len(zlib.compress(str2bytes(data), 9))) / float(len(data)))

        if truncate and e > 1.0:
            e = 1.0

        return e
Test merge
dataset/ETHPy150Open devttys0/binwalk/src/binwalk/modules/entropy.py/Entropy.gzip--crossover with--dataset/ETHPy150Open sahana/eden/modules/unit_tests/s3/s3resource.py/MergeOrganisationsTests.testMerge