if isinstance(fp, str): with gzip.open(fp, 'rb') as file: return file.read() else: return zlib.decompress(fp, 16 + zlib.MAX_WBITS)