code: def test_auto_data_transfer(path=None):
      path = Path(path)
      ds_a = Dataset(path / "a").create()
      (ds_a.pathobj / "foo.dat").write_text("foo")
      ds_a.save()
  
      # Should be the default, but just in case.
      ds_a.repo.config.set("annex.numcopies", "1", scope="local")
      ds_a.create_sibling(str(path / "b"), name="b")
  
      # With numcopies=1, no data is copied with data="auto".
      res = ds_a.push(to="b", data="auto", since=None)
      assert_not_in_results(res, action="copy")
  
      # Even when a file is explicitly given.
      res = ds_a.push(to="b", path="foo.dat", data="auto", since=None)
      assert_not_in_results(res, action="copy")
  
      # numcopies=2 changes that.
      ds_a.repo.config.set("annex.numcopies", "2", scope="local")
      res = ds_a.push(to="b", data="auto", since=None)
      assert_in_results(
          res,
          action="copy",
          target="b",
          status="ok",
          path=str(ds_a.pathobj / "foo.dat"),
      )
  
      # --since= limits the files considered by --auto.
      (ds_a.pathobj / "bar.dat").write_text("bar")
      ds_a.save()
      (ds_a.pathobj / "baz.dat").write_text("baz")
      ds_a.save()
      res = ds_a.push(to="b", data="auto", since="HEAD~1")
      assert_not_in_results(
          res, action="copy", path=str(ds_a.pathobj / "bar.dat")
      )
      assert_in_results(
          res,
          action="copy",
          target="b",
          status="ok",
          path=str(ds_a.pathobj / "baz.dat"),
      )
  
      # --auto also considers preferred content.
      ds_a.repo.config.unset("annex.numcopies", scope="local")
      ds_a.repo.set_preferred_content("wanted", "nothing", remote="b")
      res = ds_a.push(to="b", data="auto", since=None)
      assert_not_in_results(
          res, action="copy", path=str(ds_a.pathobj / "bar.dat")
      )
  
      ds_a.repo.set_preferred_content("wanted", "anything", remote="b")
      res = ds_a.push(to="b", data="auto", since=None)
      assert_in_results(
          res,
          action="copy",
          target="b",
          status="ok",
          path=str(ds_a.pathobj / "bar.dat"),
      )
  
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 15 for calling a global function with example usage: test_auto_data_transfer(path) without return types