code: def netgetdata(url, maxtry=3, timeout=10):
      
  
      err = ValueError('maxtry parameter should be greater than zero')
      for ntry in range(maxtry):
          try:
              rspns = urlrequest.urlopen(url, timeout=timeout)
              cntnt = rspns.read()
              break
          except urlerror.URLError as e:
              err = e
              if not isinstance(e.reason, socket.timeout):
                  raise
      else:
          raise err
  
      return io.BytesIO(cntnt)
docs: Get content of a file via a URL.
  
      Parameters
      ----------
      url : string
        URL of the file to be downloaded
      maxtry : int, optional (default 3)
        Maximum number of download retries
      timeout : int, optional (default 10)
        Timeout in seconds for blocking operations
  
      Returns
      -------
      str : io.BytesIO
        Buffered I/O stream
  
      Raises
      ------
      urlerror.URLError (urllib2.URLError in Python 2,
      urllib.error.URLError in Python 3)
        If the file cannot be downloaded