docs: def download(URLs, dest_dir='.', dest_file=None, decompress=False, max_jobs=5):
      '''Download files from specified URL, which should be space, tab or
      newline separated URLs. The files will be downloaded to specified
      destination. If `filename.md5` files are downloaded, they are used to
      validate downloaded `filename`. Unless otherwise specified, compressed
      files are decompressed. If `max_jobs` is given, a maximum of `max_jobs`
      concurrent download jobs will be used for each domain. This restriction
      applies to domain names and will be applied to multiple download
      instances.
      '''
      if env.config['run_mode'] == 'dryrun':
          print(f'HINT: download\n{URLs}\n')
          return None
      if isinstance(URLs, str):
          urls = [x.strip() for x in URLs.split() if x.strip()]
      else:
          urls = list(URLs)
  
      if not urls:
          env.logger.debug(f'No download URL specified: {URLs}')
          return
      #
      if dest_file is not None and len(urls) != 1:
          raise RuntimeError(
              'Only one URL is allowed if a destination file is specified.')
      #
      if dest_file is None:
          filenames = []
          for idx, url in enumerate(urls):
              token = urllib.parse.urlparse(url)
              # if no scheme or netloc, the URL is not acceptable
              if not all([
                      getattr(token, qualifying_attr)
                      for qualifying_attr in ('scheme', 'netloc')
              ]):
                  raise ValueError(f'Invalid URL {url}')
              filename = os.path.split(token.path)[-1]
              if not filename:
                  raise ValueError(f'Cannot determine destination file for {url}')
              filenames.append(os.path.join(dest_dir, filename))
      else:
          token = urllib.parse.urlparse(urls[0])
          if not all([
                  getattr(token, qualifying_attr)
                  for qualifying_attr in ('scheme', 'netloc')
          ]):
              raise ValueError(f'Invalid URL {url}')
          filenames = [dest_file]
      #
      succ = [(False, None) for x in urls]
      with ProcessPoolExecutor(max_workers=max_jobs) as executor:
          for idx, (url, filename) in enumerate(zip(urls, filenames)):
              # if there is alot, start download
              succ[idx] = executor.submit(downloadURL, url, filename, decompress,
                                          idx)
      succ = [x.result() for x in succ]
  
      # for su, url in zip(succ, urls):
      #    if not su:
      #        env.logger.warning('Failed to download {}'.format(url))
      failed = [y for x, y in zip(succ, urls) if not x]
      if failed:
          if len(urls) == 1:
              raise RuntimeError('Failed to download {urls[0]}')
          else:
              raise RuntimeError(
                  f'Failed to download {failed[0]} ({len(failed)} out of {len(urls)})'
              )
      return 0