lebeg commented on a change in pull request #12296: Separate minor refactoring from #12276 in a prior PR URL: https://github.com/apache/incubator-mxnet/pull/12296#discussion_r212222378
########## File path: ci/build.py ########## @@ -23,31 +23,88 @@ """ __author__ = 'Marco de Abreu, Kellen Sunderland, Anton Chernov, Pedro Larroy' -__version__ = '0.1' +__version__ = '0.2' import argparse import glob import logging -import os import re import shutil import subprocess import sys import tempfile -import platform from copy import deepcopy from itertools import chain -from subprocess import call, check_call +from subprocess import call, check_call, check_output from typing import * from util import * +import pprint +import requests + + +def retry(target_exception, tries=4, delay_s=1, backoff=2): + """Retry calling the decorated function using an exponential backoff. + + http://www.saltycrane.com/blog/2009/11/trying-out-retry-decorator-python/ + original from: http://wiki.python.org/moin/PythonDecoratorLibrary#Retry + + :param target_exception: the exception to check. may be a tuple of + exceptions to check + :type target_exception: Exception or tuple + :param tries: number of times to try (not retry) before giving up + :type tries: int + :param delay_s: initial delay between retries in seconds + :type delay_s: int + :param backoff: backoff multiplier e.g. value of 2 will double the delay + each retry + :type backoff: int + """ + import time Review comment: I think it's better to do the imports at the top of the file in this case ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
