def may_inject(context):
 view = context.get('view')
 return (bool(view) and bool(getattr(view, 'xtheme_injection', True)))

def may_inject ( context ) : view = context . get ( 'view' ) return ( bool ( view ) and bool ( getattr ( view , 'xtheme_injection' , True ) ) )
figure out if we may inject xtheme editing into this view .