parameters: (self, data, truncate=True)
return_statement: return e
docstring: Performs an entropy analysis based on zlib compression ratio.
          This is faster than the shannon entropy analysis, but not as accurate.
docstring_summary: Performs an entropy analysis based on zlib compression ratio.
          This is faster than the shannon entropy analysis, but not as accurate.
docstring_tokens: Performs an entropy analysis based on zlib compression ratio . This is faster than the shannon entropy analysis but not as accurate .
function: def gzip(self, data, truncate=True):
          '''
          Performs an entropy analysis based on zlib compression ratio.
          This is faster than the shannon entropy analysis, but not as accurate.
          '''
          # 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
function_tokens: 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