def get_progress(self):
        error = False
        error_message = ''
        try:
            info = self.task.info
        except (__HOLE__, NotImplementedError):
            current = total = percent = None
            logging.exception("No celery result backend?")
        else:
            if info is None:
                current = total = percent = None
            elif isinstance(info, Exception):
                current = total = percent = 100
                error = True
                error_message = "%s: %s" % (type(info).__name__, info)
            else:
                current = info.get('current')
                total = info.get('total')
                percent = int(
                    current * 100. / total if total and current is not None
                    else 0
                )
        return {
            'current': current,
            'total': total,
            'percent': percent,
            'error': error,
            'error_message': error_message,
        }
dataset/ETHPy150Open dimagi/commcare-hq/corehq/ex-submodules/soil/__init__.py/DownloadBase.get_progress