code: def test_deps_outs_are_sorted_by_path(tmp_dir, dvc, run_head):
      tmp_dir.gen(FS_STRUCTURE)
      deps = ["foo", "bar", "foobar"]
      run_head(*deps, name="copy-first-line")
  
      initial_content = read_lock_file()
      lock = initial_content["stages"]["copy-first-line"]
  
      # lock stage key order:
      assert list(lock.keys()) == ["cmd", "deps", "outs"]
  
      # `path` key appear first and then the `md5`
      assert all(
          list(dep.keys()) == ["path", "hash", "md5", "size"]
          for dep in lock["deps"]
      )
      assert all(
          list(out.keys()) == ["path", "hash", "md5", "size"]
          for out in lock["outs"]
      )
  
      # deps are always sorted by the file path naming
      assert list(map(itemgetter("path"), lock["deps"])) == sorted(deps)
  
      # outs are too
      assert list(map(itemgetter("path"), lock["outs"])) == [
          d + "-1" for d in sorted(deps)
      ]
  
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 3 for calling a global function with example usage: test_deps_outs_are_sorted_by_path(tmp_dir, dvc, run_head) without return types