docs: def GitHub_raise_for_status(r):
      """
      Call instead of r.raise_for_status() for GitHub requests
  
      Checks for common GitHub response issues and prints messages for them.
      """
      # This will happen if the doctr session has been running too long and the
      # OTP code gathered from GitHub_login has expired.
  
      # TODO: Refactor the code to re-request the OTP without exiting.
      if r.status_code == 401 and r.headers.get('X-GitHub-OTP'):
          raise GitHubError("The two-factor authentication code has expired. Please run doctr configure again.")
      if r.status_code == 403 and r.headers.get('X-RateLimit-Remaining') == '0':
          reset = int(r.headers['X-RateLimit-Reset'])
          limit = int(r.headers['X-RateLimit-Limit'])
          reset_datetime = datetime.datetime.fromtimestamp(reset, datetime.timezone.utc)
          relative_reset_datetime = reset_datetime - datetime.datetime.now(datetime.timezone.utc)
          # Based on datetime.timedelta.__str__
          mm, ss = divmod(relative_reset_datetime.seconds, 60)
          hh, mm = divmod(mm, 60)
          def plural(n):
              return n, abs(n) != 1 and "s" or ""
  
          s = "%d minute%s" % plural(mm)
          if hh:
              s = "%d hour%s, " % plural(hh) + s
          if relative_reset_datetime.days:
              s = ("%d day%s, " % plural(relative_reset_datetime.days)) + s
          authenticated = limit >= 100
          message = """\
  Your GitHub API rate limit has been hit. GitHub allows {limit} {un}authenticated
  requests per hour. See {documentation_url}
  for more information.
  """.format(limit=limit, un="" if authenticated else "un", documentation_url=r.json()["documentation_url"])
          if authenticated:
              message += """
  Note that GitHub's API limits are shared across all oauth applications. A
  common cause of hitting the rate limit is the Travis "sync account" button.
  """
          else:
              message += """
  You can get a higher API limit by authenticating. Try running doctr configure
  again without the --no-upload-key flag.
  """
          message += """
  Your rate limits will reset in {s}.\
  """.format(s=s)
          raise GitHubError(message)
      r.raise_for_status()