code: def test_download_url_return(toppath=None, topurl=None, outdir=None):
      # Ensure that out directory has trailing slash.
      outdir = opj(outdir, "")
      files = ["file1.txt", "file2.txt"]
      urls = [topurl + f for f in files]
      outfiles = [opj(outdir, f) for f in files]
  
      out1 = download_url(urls[0], path=outdir, save=False)
      assert_result_count(out1, 1)
      eq_(out1[0]["path"], outfiles[0])
  
      # can't overwrite
      out2 = download_url(
          urls, path=outdir, on_failure="ignore", save=False
      )
      assert_result_count(out2, 1, status="error")
      assert_in("file1.txt already exists", out2[0]["message"])
      assert_result_count(out2, 1, status="ok")  # only 2nd one
      eq_(out2[1]["path"], outfiles[1])
  
      out3 = download_url(
          urls,
          path=outdir,
          overwrite=True,
          on_failure="ignore",
          save=False,
      )
      assert_result_count(out3, 2, status="ok")
      eq_([r["path"] for r in out3], outfiles)
  
file_path: datalad/datalad/local/tests/test_download_url.py
imports: import os
  from os.path import join
  from datalad.api import Dataset, clone, download_url
  from datalad.tests.utils_pytest import DEFAULT_REMOTE, assert_cwd_unchanged, assert_false, assert_in, assert_in_results, assert_message, assert_not_in, assert_result_count, create_tree, eq_, ok_, ok_exists, serve_path_via_http, skip_if_no_network, slow, with_tempfile, with_tree
  from datalad.utils import Path, chpwd
label_desc: Use image node_id 3 for calling a global function with example usage: test_download_url_return(toppath, topurl, outdir) without return types