code: def test_params_file_tracked_for_composite_list(tmp_dir, dvc):
      foreach_data = [{"thresh": "foo"}, {"thresh": "bar"}]
      params = {"models": foreach_data}
      (tmp_dir / "params.yaml").dump(params)
  
      resolver = DataResolver(dvc, tmp_dir.fs_path, {})
      data = {
          "foreach": "${models}",
          "do": {"cmd": "echo ${item.thresh}"},
      }
      definition = ForeachDefinition(
          resolver, resolver.context, "build", data
      )
  
      assert definition.resolve_all() == {
          "build@0": {"cmd": "echo foo"},
          "build@1": {"cmd": "echo bar"},
      }
      assert resolver.context == {"models": foreach_data}
      assert resolver.tracked_vars == {
          "build@0": {"params.yaml": {"models.0.thresh": "foo"}},
          "build@1": {"params.yaml": {"models.1.thresh": "bar"}},
      }
  
imports: import os
  import pytest
  from dvc.parsing import DEFAULT_PARAMS_FILE, DataResolver, ForeachDefinition
  from dvc.parsing.context import Context
label_desc: Use image node_id 8 for calling a global function with example usage: test_params_file_tracked_for_composite_list(tmp_dir, dvc) without return types