def __init__(self, context_model=None, attributes=None, parent=None):
super(ContextSettingsWidget, self).__init__(parent)<EOL>ContextViewMixin.__init__(self, context_model)<EOL>self.schema_keys = set(self.schema_dict.iterkeys())<EOL>if attributes:<EOL><INDENT>self.schema_keys &= set(attributes)<EOL>assert self.schema_keys<EOL><DEDENT>schema_dict = dict((k, v) for k, v in self.schema_dict.iteritems()<EOL>if k in self.schema_keys)<EOL>self.schema = Schema(schema_dict)<EOL>self.edit = QtGui.QTextEdit()<EOL>self.edit.setStyleSheet("<STR_LIT>")<EOL>self.default_btn = QtGui.QPushButton("<STR_LIT>")<EOL>self.discard_btn = QtGui.QPushButton("<STR_LIT>")<EOL>self.apply_btn = QtGui.QPushButton("<STR_LIT>")<EOL>self.discard_btn.setEnabled(False)<EOL>self.apply_btn.setEnabled(False)<EOL>btn_pane = create_pane([None, self.default_btn, self.discard_btn,<EOL>self.apply_btn], True)<EOL>layout = QtGui.QVBoxLayout()<EOL>layout.addWidget(self.edit)<EOL>layout.addWidget(btn_pane)<EOL>self.setLayout(layout)<EOL>self.apply_btn.clicked.connect(self.apply_changes)<EOL>self.default_btn.clicked.connect(self.set_defaults)<EOL>self.discard_btn.clicked.connect(partial(self.discard_changes, True))<EOL>self.edit.textChanged.connect(self._settingsChanged)<EOL>self._update_text()<EOL>
Args:
    attributes (list of str): Select only certain settings to expose. If
        None, all settings are exposed.