code: def test_newthings_coming_down(originpath=None, destpath=None):
      origin = GitRepo(originpath, create=True)
      create_tree(originpath, {"load.dat": "heavy"})
      Dataset(originpath).save("load.dat")
      ds = install(
          source=originpath,
          path=destpath,
          result_xfm="datasets",
          return_type="item-or-list",
      )
      assert_is_instance(ds.repo, GitRepo)
      assert_in(DEFAULT_REMOTE, ds.repo.get_remotes())
      # turn origin into an annex
      origin = AnnexRepo(originpath, create=True)
      # clone doesn't know yet
      assert_false(knows_annex(ds.path))
      # but after an update it should
      # no merge, only one sibling, no parameters should be specific enough
      assert_result_count(ds.update(), 1, status="ok", type="dataset")
      assert knows_annex(ds.path)
      # no branches appeared
      eq_(ds.repo.get_branches(), [DEFAULT_BRANCH])
      # now merge, and get an annex
      assert_result_count(
          ds.update(merge=True),
          1,
          action="update",
          status="ok",
          type="dataset",
      )
      assert_in("git-annex", ds.repo.get_branches())
      assert_is_instance(ds.repo, AnnexRepo)
      # should be fully functional
      testfname = opj(ds.path, "load.dat")
      assert_false(ds.repo.file_has_content(testfname))
      ds.get(".")
      ok_file_has_content(opj(ds.path, "load.dat"), "heavy")
      # check that a new tag comes down
      origin.tag("first!")
      assert_result_count(ds.update(), 1, status="ok", type="dataset")
      eq_(ds.repo.get_tags(output="name")[0], "first!")
  
      # and now we destroy the remote annex
      origin.call_git(["config", "--remove-section", "annex"])
      rmtree(opj(origin.path, ".git", "annex"), chmod_files=True)
      origin.call_git(["branch", "-D", "git-annex"])
      origin = GitRepo(originpath)
      assert_false(knows_annex(originpath))
  
      # and update the local clone
      # for now this should simply not fail (see gh-793), later might be enhanced to a
      # graceful downgrade
      before_branches = ds.repo.get_branches()
      ok_(any("git-annex" in b for b in ds.repo.get_remote_branches()))
      assert_result_count(ds.update(), 1, status="ok", type="dataset")
      eq_(before_branches, ds.repo.get_branches())
      # annex branch got pruned
      assert_false(
          any("git-annex" in b for b in ds.repo.get_remote_branches())
      )
      # check that a new tag comes down even if repo types mismatch
      origin.tag("second!")
      assert_result_count(ds.update(), 1, status="ok", type="dataset")
      eq_(ds.repo.get_tags(output="name")[-1], "second!")
  
imports: import os
  import os.path
  from os.path import exists
  from os.path import join
  from unittest.mock import patch
  import pytest
  from datalad import cfg
  from datalad.api import clone, install, remove, update
  from datalad.distribution.update import _process_how_args
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.external_versions import external_versions
  from datalad.support.gitrepo import GitRepo
  from datalad.tests.utils_pytest import DEFAULT_BRANCH, DEFAULT_REMOTE, SkipTest, assert_false, assert_in, assert_in_results, assert_is_instance, assert_not_in, assert_raises, assert_repo_status, assert_result_count, assert_status, create_tree, eq_, known_failure_windows, maybe_adjust_repo, neq_, ok_, ok_file_has_content, skip_if_adjusted_branch, slow, with_tempfile
  from datalad.utils import Path, chpwd, knows_annex, rmtree
  from ..dataset import Dataset
label_desc: Use image node_id 4 for calling a global function with example usage: test_newthings_coming_down(originpath, destpath) without return types