code: def download_resource(self, download_url, target, guard):
          
          download_url = download_url.strip()
          if not os.path.isabs(target):
              target = os.path.join(config.config_dir, target)
  
          if os.path.exists(os.path.join(target, guard)):
              self.LOG.info("Already have '%s' in '%s'..." % (download_url, target))
              return
  
          if not os.path.isdir(target):
              os.makedirs(target)
  
          self.LOG.info("Downloading '%s' to '%s'..." % (download_url, target))
          with closing(urllib2.urlopen(download_url)) as url_handle:
              if download_url.endswith(".zip"):
                  with closing(ZipFile(StringIO(url_handle.read()))) as zip_handle:  # pylint: disable=no-member
                      zip_handle.extractall(target)  # pylint: disable=no-member
              else:
                  with open(os.path.join(target, guard), "wb") as file_handle:
                      shutil.copyfileobj(url_handle, file_handle)
docs: Helper to download and install external resources.