def _save_picture(data, path): try: io.imsave(path, data) return True except (KeyError, TypeError): return False