python code to decompress a file and return the value in a variable(in memory)

import gzip


def decompress(file_path):
with gzip.open(file_path, 'rb') as f:
decompressed_data = f.read().decode('utf-8')
return decompressed_data


print(decompress("output.tar.gz"))