'A template with placeholders and/or source code loaded from the given string or path.
Placeholders that start with $ are replaced with keyword arguments in Template.render().
Source code enclosed in <?= var + 100 ?> is executed with eval().
Source code enclosed in <? write(var) ?> is executed with exec().'

def __init__(self, path, root=None, cached=True):

    p = os.path.join((root or ''), path)
    k = hash(p)
    b = (k in Template._cache)
    if ((cached is True) and (b is True)):
        a = Template._cache[k]
    if ((cached is False) or (b is False)):
        a = (''.join(static(p, mimetype='text/html')) if os.path.exists(p) else path)
        a = self._compile(a)
    if ((cached is True) and (b is False)):
        a = Template._cache.setdefault(k, a)
    self._compiled = a
