code: def test_invalid_args(path=None, otherpath=None, alienpath=None):
      # source == path
      assert_raises(ValueError, clone, "Zoidberg", path="Zoidberg")
      assert_raises(
          ValueError,
          clone,
          "ssh://mars/Zoidberg",
          path="ssh://mars/Zoidberg",
      )
  
      # "invalid URL" is a valid filepath... and since no clone to remote
      # is possible - we can just assume that it is the (legit) file path
      # which is provided, not a URL.  So both below should fail as any
      # other clone from a non-existing source and not for the reason of
      # "invalid something".  Behavior is similar to how Git performs - can
      # clone into a URL-like path.
  
      # install to an "invalid URL" path
      res = clone(
          "Zoidberg",
          path="ssh://mars:Zoidberg",
          on_failure="ignore",
          result_xfm=None,
      )
      assert_status("error", res)
  
      # install to a "remote location" path
      res = clone(
          "Zoidberg",
          path="ssh://mars/Zoidberg",
          on_failure="ignore",
          result_xfm=None,
      )
      assert_status("error", res)
  
      # make fake dataset
      ds = create(path)
      assert_raises(
          IncompleteResultsError, ds.clone, "/higherup.", "Zoidberg"
      )
      # make real dataset, try to install outside
      ds_target = create(Path(otherpath) / "target")
      assert_raises(ValueError, ds_target.clone, ds.path, path=ds.path)
      assert_status(
          "error",
          ds_target.clone(
              ds.path,
              path=alienpath,
              on_failure="ignore",
              result_xfm=None,
          ),
      )
  
imports: import logging
  import os.path
  import stat
  from unittest.mock import patch
  import pytest
  from datalad import consts
  from datalad.api import clone, create, remove
  from datalad.cmd import GitWitlessRunner
  from datalad.cmd import WitlessRunner
  from datalad.config import ConfigManager
  from datalad.core.distributed.clone_utils import _get_installationpath_from_url, decode_source_spec
  from datalad.distribution.dataset import Dataset
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.exceptions import IncompleteResultsError
  from datalad.support.external_versions import external_versions
  from datalad.support.gitrepo import GitRepo
  from datalad.support.network import get_local_file_url
  from datalad.tests.utils_pytest import DEFAULT_BRANCH, DEFAULT_REMOTE, SkipTest, assert_false, assert_in, assert_in_results, assert_message, assert_not_in, assert_not_is_instance, assert_raises, assert_repo_status, assert_result_count, assert_result_values_equal, assert_status, create_tree, eq_, get_datasets_topdir, has_symlink_capability, integration, known_failure, known_failure_githubci_win, known_failure_osx, known_failure_windows, neq_, nok_, ok_, ok_file_has_content, ok_startswith, on_github, on_osx, on_travis, patch_config, serve_path_via_http, set_date, skip_if, skip_if_adjusted_branch, skip_if_no_network, skip_if_on_windows, skip_ssh, slow, swallow_logs, with_sameas_remote, with_tempfile, with_tree, xfail_buggy_annex_info
  from datalad.utils import Path, chpwd, get_home_envvars, on_windows, rmtree
label_desc: Use image node_id 1 for calling a global function with example usage: test_invalid_args(path, otherpath, alienpath) without return types