code: def test_get_invalid_call(path=None, file_outside=None):
      # no argument at all:
      assert_raises(InsufficientArgumentsError, get, None)
      assert_raises(InsufficientArgumentsError, get, [])
      # invalid dataset:
      assert_raises(
          ValueError, get, None, dataset=path, on_failure="ignore"
      )
  
      # have a plain git:
      ds = Dataset(path)
      ds.create(annex=False)
      with open(opj(path, "some.txt"), "w") as f:
          f.write("whatever")
      ds.save("some.txt", to_git=True, message="Initial commit.")
  
      # make it an annex (remove indicator file that create has placed
      # in the dataset to make it possible):
      (ds.pathobj / ".noannex").unlink()
      AnnexRepo(path, init=True, create=True)
      # call get again on a file in git:
      result = ds.get("some.txt")
      assert_status("notneeded", result)
  
      # invalid source:
      # yoh:  but now we would need to add it to annex since clever code first
      # checks what needs to be fetched at all
      create_tree(path, {"annexed.dat": "some"})
      ds.save("annexed.dat")
      ds.repo.drop("annexed.dat", options=["--force"])
      with assert_raises(RemoteNotAvailableError) as cme:
          ds.get("annexed.dat", source="MysteriousRemote")
      eq_("MysteriousRemote", cme.value.remote)
  
      res = ds.get("NotExistingFile.txt", on_failure="ignore")
      assert_status("impossible", res)
      assert_message("path does not exist", res)
  
      # path outside repo errors as with most other commands:
      res = ds.get(
          file_outside, on_failure="ignore", result_renderer="default"
      )
      assert_in_results(
          res,
          status="error",
          message=("path not associated with dataset %s", ds),
      )
  
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 2 for calling a global function with example usage: test_get_invalid_call(path, file_outside) without return types