'Internal helper function to create a derived context.  This is
used in situations where the system needs a new context in the same
template that is independent.'

def derived(self, locals=None):

    context = new_context(self.environment, self.name, {}, self.get_all(), True, None, locals)
    context.eval_ctx = self.eval_ctx
    context.blocks.update(((k, list(v)) for (k, v) in iteritems(self.blocks)))
    return context
