code: def test_push_subds_no_recursion(
      src_path=None, dst_top=None, dst_sub=None, dst_subsub=None
  ):
      # dataset with one submodule and one subsubmodule
      top = Dataset(src_path).create()
      sub = top.create("sub m")
      test_file = sub.pathobj / "subdir" / "test_file"
      test_file.parent.mkdir()
      test_file.write_text("some")
      subsub = sub.create(sub.pathobj / "subdir" / "subsub m")
      top.save(recursive=True)
      assert_repo_status(top.path)
      target_top = mk_push_target(top, "target", dst_top, annex=True)
      target_sub = mk_push_target(sub, "target", dst_sub, annex=True)
      target_subsub = mk_push_target(
          subsub, "target", dst_subsub, annex=True
      )
      # now publish, but NO recursion, instead give the parent dir of
      # both a subdataset and a file in the middle subdataset
      res = top.push(
          to="target",
          # give relative to top dataset to elevate the difficulty a little
          path=str(test_file.relative_to(top.pathobj).parent),
      )
      assert_status("ok", res)
      assert_in_results(
          res, action="publish", type="dataset", path=top.path
      )
      assert_in_results(
          res, action="publish", type="dataset", path=sub.path
      )
      assert_in_results(
          res, action="copy", type="file", path=str(test_file)
      )
      # the lowest-level subdataset isn't touched
      assert_not_in_results(
          res, action="publish", type="dataset", path=subsub.path
      )
  
imports: import logging
  import os
  import pytest
  from datalad.core.distributed.clone import Clone
  from datalad.core.distributed.push import Push
  from datalad.distribution.dataset import Dataset
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.exceptions import IncompleteResultsError, InsufficientArgumentsError
  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_not_in, assert_not_in_results, assert_raises, assert_repo_status, assert_result_count, assert_status, eq_, known_failure_githubci_osx, known_failure_githubci_win, neq_, ok_, ok_file_has_content, serve_path_via_http, skip_if_adjusted_branch, skip_if_on_windows, skip_ssh, slow, swallow_logs, with_tempfile, with_tree
  from datalad.utils import Path, chpwd, path_startswith, swallow_outputs
label_desc: Use image node_id 7 for calling a global function with example usage: test_push_subds_no_recursion(src_path, dst_top, dst_sub, dst_subsub) without return types