def METHOD_NAME(subs, template):
  for key, value in subs.items():
    template = template.replace("${"+key+"}", value)
  assert template.find("${") < 0, "Incomplete substitutions."
  return template[1:]