code: def test_SafeTemplate(self):
      eq = self.assertEqual
      s = Template("$who likes ${what} for ${meal}")
      eq(
          s.safe_substitute(dict(who="tim")),
          "tim likes ${what} for ${meal}",
      )
      eq(
          s.safe_substitute(dict(what="ham")),
          "$who likes ham for ${meal}",
      )
      eq(
          s.safe_substitute(dict(what="ham", meal="dinner")),
          "$who likes ham for dinner",
      )
      eq(
          s.safe_substitute(dict(who="tim", what="ham")),
          "tim likes ham for ${meal}",
      )
      eq(
          s.safe_substitute(dict(who="tim", what="ham", meal="dinner")),
          "tim likes ham for dinner",
      )
  
imports: import unittest
  import string
  from string import Template
label_desc: Use image node_id 9 for calling the TestTemplate obj's underlying member method code with example usage: obj.test_SafeTemplate() without return types