def ext_decompress(data):
    global has_cmdline_bunzip2
    if (has_cmdline_bunzip2 is None):
        has_cmdline_bunzip2 = bool(shutil.which('bunzip2'))
    if has_cmdline_bunzip2:
        return subprocess.check_output(['bunzip2'], input=data)
    else:
        return bz2.decompress(data)
def ext_decompress(data):
    global has_cmdline_bunzip2
    if (has_cmdline_bunzip2 is None):
        has_cmdline_bunzip2 = bool(shutil.which('bunzip2'))
    if has_cmdline_bunzip2:
        return subprocess.check_output(['bunzip2'], input=data)
    else:
        return bz2.decompress(data)