def archive_retrieve_one(self, name):
        try:
            archive_id = self.cache.get_archive_id(self.args.vault, name)
        except __HOLE__:
            raise ConsoleError('archive %r not found' % name)

        vault = self.connection.get_vault(self.args.vault)
        retrieval_jobs = find_retrieval_jobs(vault, archive_id)

        complete_job = find_complete_job(retrieval_jobs)
        if complete_job:
            self._archive_retrieve_completed(self.args, complete_job, name)
        elif has_pending_job(retrieval_jobs):
            if self.args.wait:
                complete_job = wait_until_job_completed(retrieval_jobs)
                self._archive_retrieve_completed(self.args, complete_job, name)
            else:
                raise RetryConsoleError('job still pending for archive %r' % name)
        else:
            # create an archive retrieval job
            job = vault.retrieve_archive(archive_id)
            if self.args.wait:
                wait_until_job_completed([job])
                self._archive_retrieve_completed(self.args, job, name)
            else:
                raise RetryConsoleError('queued retrieval job for archive %r' % name)
dataset/ETHPy150Open basak/glacier-cli/glacier.py/App.archive_retrieve_one