code: def download(self, url, dir_path, filename=None):
          
          if not filename:
              filename = url.rsplit('/', 1)[1]
          path = os.path.join(dir_path, filename)
  
          content = self.fetch(url)
          with open(path, "wb") as f:
              f.write(content)
  
          return path
docs: Download the resources specified by url into dir_path. The resulting
              file path is returned.
  
              DownloadError is raised the resources cannot be downloaded.