code: def test_get_multiple_files(path=None, url=None, ds_dir=None):
      from os import listdir
  
      from datalad.support.network import RI
  
      file_list = [f for f in listdir(path) if not f.startswith(".")]
  
      # prepare urls:
      [RI(url + f) for f in file_list]
  
      # prepare origin
      origin = Dataset(path).create(force=True)
      origin.save(file_list, message="initial")
  
      ds = install(
          ds_dir,
          source=path,
          result_xfm="datasets",
          return_type="item-or-list",
      )
  
      # no content present:
      ok_(not any(ds.repo.file_has_content(file_list)))
  
      # get two plus an invalid one:
      result = ds.get(
          ["file1.txt", "file2.txt", "not_existing.txt"],
          on_failure="ignore",
      )
      assert_status("impossible", [result[0]])
      assert_status(["ok", "notneeded"], result[1:])
      # explicitly given not existing file was skipped:
      # (see test_get_invalid_call)
      eq_(
          set([basename(item.get("path")) for item in result[1:]]),
          {"file1.txt", "file2.txt"},
      )
      ok_(all(ds.repo.file_has_content(["file1.txt", "file2.txt"])))
  
      # get all of them:
      result = ds.get(curdir)
      # there were two files left to get:
      eq_(
          set(
              [
                  basename(item.get("path"))
                  for item in result
                  if item["type"] == "file"
              ]
          ),
          {"file3.txt", "file4.txt"},
      )
      ok_(all(ds.repo.file_has_content(file_list)))
  
imports: from os import curdir
  from os.path import basename
  from os.path import join
  from unittest.mock import patch
  import pytest
  from datalad.api import clone, create, get, install
  from datalad.distribution.get import _get_flexible_source_candidates_for_submodule
  from datalad.interface.results import only_matching_paths
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.exceptions import InsufficientArgumentsError, RemoteNotAvailableError
  from datalad.support.network import get_local_file_url
  from datalad.tests.utils_testdatasets import _make_dataset_hierarchy, _mk_submodule_annex
  from datalad.tests.utils_pytest import create_tree, assert_false, assert_raises, assert_in, assert_status, assert_in_results, assert_not_in_results, assert_repo_status, assert_result_count, assert_message, DEFAULT_REMOTE, eq_, known_failure_windows, known_failure_githubci_win, ok_, serve_path_via_http, skip_if_adjusted_branch, skip_ssh, skip_if_on_windows, slow, with_tempfile, with_tree
  from datalad.utils import Path, chpwd, rmtree, with_pathsep
  from ..dataset import Dataset
label_desc: Use image node_id 5 for calling a global function with example usage: test_get_multiple_files(path, url, ds_dir) without return types