code: def test_rerun_assume_ready(path=None):
      ds = Dataset(path).create()
      repo = ds.repo
      (repo.pathobj / "f1").write_text("f1\n")
      ds.save()
  
      def double_in_both_cmd(src, dest1, dest2):
          return [
              sys.executable,
              "-c",
              "import sys; import os; import os.path as op; "
              "content = open(sys.argv[-3]).read() * 2; "
              "d1 = sys.argv[-2]; d2 = sys.argv[-1]; "
              "op.lexists(d1) and os.unlink(d1); "
              "op.lexists(d2) and os.unlink(d2); "
              "open(d1, 'w').write(content); open(d2, 'w').write(content)",
              src,
              dest1,
              dest2,
          ]
  
      ds.run(double_in_both_cmd("f1", "out1", "out2"), outputs=["out1"])
      # Drop the content so that we remove instead of unlock, making the test is
      # more meaningful on an adjusted branch.
      ds.drop(["out1", "out2"], reckless="kill")
      # --assume-ready affects both explicitly specified and automatic outputs.
      res = ds.rerun(assume_ready="outputs")
      assert_not_in_results(res, action="remove")
  
imports: import logging
  import os.path
  import sys
  from io import StringIO
  from os import remove
  import pytest
  from unittest.mock import patch
  from datalad.api import install, run
  from datalad.core.local.run import run_command
  from datalad.core.local.tests.test_run import last_commit_msg
  from datalad.distribution.dataset import Dataset
  from datalad.local.rerun import diff_revision, get_run_info, new_or_modified
  from datalad.support.exceptions import CommandError, IncompleteResultsError
  from datalad.support.gitrepo import GitRepo
  from datalad.tests.utils_pytest import DEFAULT_BRANCH, DEFAULT_REMOTE, SkipTest, assert_dict_equal, assert_false, assert_in, assert_in_results, assert_not_in, assert_not_in_results, assert_raises, assert_repo_status, assert_result_count, assert_status, create_tree, eq_, known_failure_windows, neq_, ok_, ok_exists, ok_file_has_content, ok_file_under_git, skip_if_adjusted_branch, slow, swallow_logs, swallow_outputs, with_tempfile, with_tree
  from datalad.utils import Path, chpwd, on_windows
label_desc: Use image node_id 18 for calling a global function with example usage: test_rerun_assume_ready(path) and returns: list