parameters: (self, url)
docstring: Checks if a provided url is available
  
              Parameters
              ----------
              `url`: str
                  Package url to be tested.
docstring_summary: Checks if a provided url is available
docstring_tokens: Checks if a provided url is available
function: def test_request(self, url):
          """Checks if a provided url is available
  
              Parameters
              ----------
              `url`: str
                  Package url to be tested.
          """
          url = url.split("://")
          url[-1] = urllib.parse.quote(url[-1])
          url = "://".join(url)
          request = Request(url)
          request.get_method = lambda : 'HEAD'
          attempts = 3
          while attempts:
              try:
                  _ = urlopen(request, timeout=100)
                  return url
              except HTTPError:
                  return None
              except URLError:
                  attempts -= 1
                  if attempts == 0:
                      raise
                  print("Cannot reach {}, attempts left {}".format(url, attempts))
function_tokens: def test_request ( self , url ) : url = url . split ( "://" ) url [ - 1 ] = urllib . parse . quote ( url [ - 1 ] ) url = "://" . join ( url ) request = Request ( url ) request . get_method = lambda : 'HEAD' attempts = 3 while attempts : try : _ = urlopen ( request , timeout = 100 ) return url except HTTPError : return None except URLError : attempts -= 1 if attempts == 0 : raise print ( "Cannot reach {}, attempts left {}" . format ( url , attempts ) )