code: def download(self, url, text=False, checksum=True):
      if py3:
          import urllib.request
  
          urlopen = urllib.request.urlopen
          import io
  
          bytesio = io.BytesIO
      else:
          import urllib2
  
          urlopen = urllib2.urlopen
          import cStringIO
  
          bytesio = cStringIO.StringIO
  
      write("    Fetching", url)
      count = 0
      while True:
          try:
              if count:
                  write("        Try #", str(count + 1))
              try:
                  page = urlopen(url).read()
              except:
                  # Degrade to http if https is not supported
                  e = sys.exc_info()[1]
                  if (
                      "eof occurred in violation of protocol"
                      in str(e).lower()
                      or getattr(e, "reason")
                      == "unknown url type: https"
                  ):
                      write(
                          "        [Python has https issues - using http instead]"
                      )
                      page = urlopen(
                          url.replace("https://", "http://")
                      ).read()
                  else:
                      raise
              break
          except:
              write("       Error ", str(sys.exc_info()[1]))
              time.sleep(1.3)
              count += 1
              if count >= 5:
                  raise
  
      if text:
          if py3:
              page = page.decode("iso8859_1")
  
      if checksum:
          self.verifyurl(url, page)
  
      if not text:
          page = bytesio(page)
  
      return page
  
imports: import os
  import sys
  import shlex
  import glob
  import re
  import time
  import zipfile
  import tarfile
  from distutils.command import build_ext, build, sdist
label_desc: Use image node_id 5 for calling the fetch obj's underlying member method code with example usage: obj.download(url, text, checksum) and returns: page