import zipfile


def zip_extract_all(file_path, tmp_dir):
    """Extracts the contents of a ZIP file."""
    extracted = False
    try:
        zf = zipfile.ZipFile(file_path, "r")
        zf.extractall(tmp_dir)
        zf.close()
        extracted = tmp_dir
    except Exception as e:
        print("Error extracting ZIP file: {}".format(e))
    return extracted