'Evaluate the template given the values and functions.'

def substitute(self, values={}, functions={}):

    try:
        res = self.compiled(values, functions)
    except:
        res = self.interpret(values, functions)
    return res
