def sub_tempita(s, context, file=None, name=None):
    """Run tempita on string s with given context."""
    if not s:
        return None
    if file:
        context['__name'] = '%s:%s' % (file, name)
    elif name:
        context['__name'] = name
    from ..Tempita import sub
    return sub(s, **context)
