if context.autoescape is true and output is not an instance of SafeData class or output is an instance of EscapeData class,
if ( context . autoescape and not isinstance ( output , SafeData ) ) or isinstance ( output , EscapeData ) :