code: def substitute(self, values={}, functions={}):
          
          try:
              res = self.compiled(values, functions)
          except Exception:  # Handle any exceptions thrown by compiled version.
              res = self.interpret(values, functions)
  
          return res
docs: Evaluate the template given the values and functions.