code: def _download(url, dest):
      
  
      print('Downloading %s' % url)
      filename = os.path.basename(url)
      dest_path = os.path.join(dest, filename)
  
      if sys.platform == 'win32':
          powershell_exe = os.path.join('system32\\WindowsPowerShell\\v1.0\\powershell.exe')
          code = "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;"
          code += "(New-Object Net.WebClient).DownloadFile('%s', '%s');" % (url, dest_path)
          _execute([powershell_exe, '-Command', code], dest)
  
      else:
          _execute(['curl', '-L', '--silent', '--show-error', '-O', url], dest)
  
      return dest_path
docs: Downloads a URL to a directory
  
      :param url:
          The URL to download
  
      :param dest:
          The path to the directory to save the file in
  
      :return:
          The filesystem path to the saved file