code: def render(self, hosts, vars={}):
          
          if self.tpl_file.endswith(".tpl"):
              return self._render_mako(hosts, vars)
          elif self.tpl_file.endswith(".py"):
              return self._render_py(hosts, vars)
          else:
              raise ValueError("Don't know how to handle '{0}'".format(self.tpl_file))
docs: Render a mako or .py file.