def do_download(self, args):
        try:
            #add arguments
            doParser = self.arg_download()
            try:
                doArgs = doParser.parse_args(args.split())
            except SystemExit as e:
                return
            #call UForge API
            printer.out("Searching image with id ["+doArgs.id+"] ...")
            images = self.api.Users(self.login).Images.Get()
            images = images.images.image
            if images is None or len(images) == 0:
                printer.out("No images available")
            else:
                dlImage = None
                for image in images:
                    if str(image.dbId) == str(doArgs.id):
                        dlImage=image
                if dlImage is not None and dlImage.status.complete and not dlImage.status.error and dlImage.compress:
                    download_url = self.api._url+"/"+dlImage.downloadUri
                    dlUtils = download_utils.Download(download_url, doArgs.file)
                    try:
                        dlUtils.start()
                    except Exception, e:
                        return
                    printer.out("Image downloaded", printer.OK)
                elif dlImage is None:
                    printer.out("Unable to find the image to download in your library", printer.ERROR)
                elif not dlImage.status.complete:
                    printer.out("The image is being generated. Unable to download. Please retry later", printer.ERROR)
                elif not dlImage.compress:
                    printer.out("The image has been prepared to be published (not compressed). Cannot download.", printer.ERROR)
                else:
                    printer.out("Cannot download this image", printer.ERROR)


        except ArgumentParserError as e:
            printer.out("ERROR: In Arguments: "+str(e), printer.ERROR)
            self.help_download()
        except Exception as e:
            return handle_uforge_exception(e)
dataset/ETHPy150Open usharesoft/hammr/src/hammr/commands/image/image.py/Image.do_download/original