def save_image(byteio, imgfmt):
from os import path, mkdir<EOL>ptdir = "<STR_LIT>".format(project, task)<EOL>uuid = str(uuid4())<EOL>idir = path.join(dbdir, ptdir)<EOL>if not path.isdir(idir):<EOL><INDENT>mkdir(idir)<EOL><DEDENT>ipath = path.join(idir, "<STR_LIT>".format(uuid, imgfmt))<EOL>with open(ipath, '<STR_LIT:wb>') as f:<EOL><INDENT>f.write(byteio)<EOL><DEDENT>return uuid<EOL>
Saves the specified image to disk.

    Args:
        byteio (bytes): image bytes to save to disk.
        imgfmt (str): used as the extension of the saved file.

    Returns:
        str: a uuid for the saved image that can be added to the database entry.