'Input signal handler'

def ctree(self, model=None):

    self.clear_scene()
    self.color_combo.clear()
    self.closeContext()
    self.model = model
    self.target_class_index = 0
    if (model is None):
        self.info.setText('No    tree.')
        self.root_node = None
        self.dataset = None
        self.tree_adapter = None
    else:
        self.tree_adapter = self._get_tree_adapter(model)
        self.domain = model.domain
        self.dataset = model.instances
        if ((self.dataset is not None) and (self.dataset.domain != self.domain)):
            self.clf_dataset = self.dataset.transform(model.domain)
        else:
            self.clf_dataset = self.dataset
        class_var = self.domain.class_var
        if class_var.is_discrete:
            self.scene.colors = [QColor(*col) for col in class_var.colors]
            self.color_label.setText('Target    class:    ')
            self.color_combo.addItem('None')
            self.color_combo.addItems(self.domain.class_vars[0].values)
            self.color_combo.setCurrentIndex(self.target_class_index)
        else:
            self.scene.colors = ContinuousPaletteGenerator(*model.domain.class_var.colors)
            self.color_label.setText('Color    by:    ')
            self.color_combo.addItems(self.COL_OPTIONS)
            self.color_combo.setCurrentIndex(self.regression_colors)
        self.openContext(self.domain.class_var)
        self.root_node = self.walkcreate(self.tree_adapter.root)
        self.info.setText('{}    nodes,    {}    leaves'.format(self.tree_adapter.num_nodes, len(self.tree_adapter.leaves(self.tree_adapter.root))))
    self.setup_scene()
    self.send('Selected    Data', None)
    self.send(ANNOTATED_DATA_SIGNAL_NAME, create_annotated_table(self.dataset, []))
