def retry(num=<NUM_LIT:5>):
s = requests.Session()<EOL>retries = Retry(total=num, backoff_factor=<NUM_LIT:0.1>,<EOL>status_forcelist=[<NUM_LIT>, <NUM_LIT>, <NUM_LIT>, <NUM_LIT>])<EOL>s.mount('<STR_LIT>', HTTPAdapter(max_retries=retries))<EOL>return s<EOL>
retry connection.

        define max tries num
        if the backoff_factor is 0.1, then sleep() will sleep for
        [0.1s, 0.2s, 0.4s, ...] between retries.
        It will also force a retry if the status code returned is 500, 502, 503 or 504.