code: def test_foreach_partial_interpolations(tmp_dir, dvc):
      resolver = DataResolver(
          dvc, tmp_dir.fs_path, {"vars": [{"bar": "bar"}]}
      )
      foreach_data = {"model1": "foo", "model2": "${bar}"}
      data = {"foreach": foreach_data, "do": {"cmd": "echo ${item}"}}
      definition = ForeachDefinition(
          resolver, resolver.context, "build", data
      )
  
      assert definition.resolve_all() == {
          "build@model1": {"cmd": "echo foo"},
          "build@model2": {"cmd": "echo bar"},
      }
      assert resolver.context == {"bar": "bar"}
      assert not any(item for item in resolver.tracked_vars.values())
  
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 10 for calling a global function with example usage: test_foreach_partial_interpolations(tmp_dir, dvc) without return types