code: def test_order_is_preserved_when_pipeline_order_changes(
      tmp_dir, dvc, run_head
  ):
      tmp_dir.gen(FS_STRUCTURE)
      deps = ["foo", "bar", "foobar"]
      stage = run_head(*deps, name="copy-first-line")
  
      initial_content = read_lock_file()
      # reverse order of stage.outs and dump to the pipeline file
      # then, again change stage.deps and dump to the pipeline file
      reversal = stage.outs.reverse, stage.deps.reverse
      for reverse_items in reversal:
          reverse_items()
          stage.dvcfile._dump_pipeline_file(stage)
  
          # we only changed the order, should not reproduce
          assert not dvc.reproduce(stage.addressing)
  
          new_lock_content = read_lock_file()
          assert_eq_lockfile(new_lock_content, initial_content)
  
          (tmp_dir / LOCK_FILE).unlink()
          assert dvc.reproduce(stage.addressing) == [stage]
          new_lock_content = read_lock_file()
          assert_eq_lockfile(new_lock_content, initial_content)
  
file_path: dvc/tests/func/test_lockfile.py
imports: from collections import OrderedDict
  from operator import itemgetter
  from dvc.dvcfile import LOCK_FILE
  from dvc.stage.utils import split_params_deps
  from dvc.utils.fs import remove
  from dvc.utils.serialize import dumps_yaml, parse_yaml_for_update
  from tests.func.test_run import supported_params
label_desc: Use image node_id 4 for calling a global function with example usage: test_order_is_preserved_when_pipeline_order_changes(tmp_dir, dvc, run_head) without return types