<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def path_to_zip(path):
 """ Compress `path` to the ZIP. Args: path (str):
 Path to the directory. Returns: str: Path to the zipped file (in /tmp). """

    if not os.path.exists(path):
        raise IOError("%s doesn't exists!" % path)

    with tempfile.NamedTemporaryFile(delete=False) as ntf:
        zip_fn = ntf.name

    with zipfile.ZipFile(zip_fn, mode="w") as zip_file:
        for root, dirs, files in os.walk(path):
            for fn in files:
                zip_file.write(os.path.join(root, fn))

    return zip_fn