code: def entrez_retry(func, *fnargs, **fnkwargs):
      
      tries, success = 0, False
      while not success and tries < args.retries:
          try:
              output = func(*fnargs, **fnkwargs)
              success = True
          except (HTTPError, URLError):
              tries += 1
              logger.warning("Entrez query %s(%s, %s) failed (%d/%d)", func,
                             fnargs, fnkwargs, tries + 1, args.retries)
              logger.warning(last_exception())
      if not success:
          logger.error("Too many Entrez failures (exiting)")
          sys.exit(1)
      return output
docs: Retries the passed function up to the number of times specified
      by args.retries