'Set up additional context variables'

def _extra_context(self):

    _ = self.capa_system.i18n.ugettext
    queue_msg = self.queue_msg
    if (len(self.queue_msg) > 0):
        try:
            etree.XML(HTML(u'<div>{0}</div>').format(HTML(self.queue_msg)))
        except etree.XMLSyntaxError:
            try:
                html5lib.parseFragment(self.queue_msg, treebuilder='lxml', namespaceHTMLElements=False)[0]
            except (IndexError, ValueError):
                queue_msg = HTML('<span>{0}</span>').format(_('Error    running    code.'))
    extra_context = {'queue_len': str(self.queue_len), 'queue_msg': queue_msg, 'button_enabled': self.button_enabled(), 'matlab_editor_js': '{static_url}js/vendor/CodeMirror/octave.js'.format(static_url=self.capa_system.STATIC_URL), 'msg': sanitize_html(self.msg)}
    return extra_context
