class_docstr: Class describing a cuda package with a key/name and a dictionary where the key
  is a cuda version and value is the list of directly accessible http links
  
  When it asked for a package version it checks compatible platform tags and provides
  a download link to a compatible package
  
  Parameters
  ----------
  `key`: str
      Name this package should be queried for
  `versions`: str or PckgVer class object
      Dictionary, where the key is a cuda version and vale, is the list
      of directly accessible http links. `{platform}` inside the link is replaced by the
      compatible platform tag provided by pip
  `name`: str, , optional, default = None
      Name of this package used during installation. If empty it is the same as the key.
      If it includes `{cuda_v}` it is replaced by the cuda_version when queried
class_docstr_tok: ["Class","describing","a","cuda","package","with","a","key\/name","and","a","dictionary","where","the","key","is","a","cuda","version","and","value","is","the","list","of","directly","accessible","http","links","When","it","asked","for","a","package","version","it","checks","compatible","platform","tags","and","provides","a","download","link","to","a","compatible","package","Parameters","--","--","--","--","--","`","key","`",":","str","Name","this","package","should","be","queried","for","`","versions","`",":","str","or","PckgVer","class","object","Dictionary",",","where","the","key","is","a","cuda","version","and","vale",",","is","the","list","of","directly","accessible","http","links",".","`","{","platform","}","`","inside","the","link","is","replaced","by","the","compatible","platform","tag","provided","by","pip","`","name","`",":","str",",",",","optional",",","default","=","None","Name","of","this","package","used","during","installation",".","If","empty","it","is","the","same","as","the","key",".","If","it","includes","`","{","cuda_v","}","`","it","is","replaced","by","the","cuda_version","when","queried"]
docstr: Checks if a provided url is available
  
  Parameters
  ----------
  `url`: str
      Package url to be tested.
docstr_tok: ["Checks","if","a","provided","url","is","available","Parameters","--","--","--","--","--","`","url","`",":","str","Package","url","to","be","tested","."]
code: 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
                  )
              )
  
imports: import argparse
  import sys
  from pip._vendor.packaging.version import parse
  import urllib.parse
  from urllib.request import urlopen, HTTPError, Request, URLError
label_desc: Use image node_id 4 for calling the CudaHttpPackage obj's underlying member method code with example usage: obj.test_request(url) and returns: url, None