{
    "file_diffs": [
        {
            "old_file_content": "import warnings\nfrom functools import partial\nfrom types import SimpleNamespace as namespace\nfrom typing import Optional  # pylint: disable=unused-import\n\nimport numpy as np\n\nfrom AnyQt.QtCore import Qt\nfrom AnyQt.QtWidgets import QFormLayout\n\nfrom Orange.data import Table, Domain\nfrom Orange.preprocess import preprocess\nfrom Orange.projection import PCA\nfrom Orange.projection import manifold\nfrom Orange.widgets import gui\nfrom Orange.widgets.settings import SettingProvider, ContextSetting\nfrom Orange.widgets.utils.concurrent import TaskState, ConcurrentWidgetMixin\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.visualize.owscatterplotgraph import OWScatterPlotBase\nfrom Orange.widgets.visualize.utils.widget import OWDataProjectionWidget\nfrom Orange.widgets.widget import Msg\n\n_STEP_SIZE = 25\n_MAX_PCA_COMPONENTS = 50\n_DEFAULT_PCA_COMPONENTS = 20\n\n\nclass Task(namespace):\n    \"\"\"Completely determines the t-SNE task spec and intermediate results.\"\"\"\n    data = None                     # type: Optional[Table]\n\n    normalize = None                # type: Optional[bool]\n    normalized_data = None          # type: Optional[Table]\n\n    use_pca_preprocessing = None    # type: Optional[bool]\n    pca_components = None           # type: Optional[int]\n    pca_projection = None           # type: Optional[Table]\n\n    perplexity = None               # type: Optional[float]\n    multiscale = None               # type: Optional[bool]\n    exaggeration = None             # type: Optional[float]\n    initialization = None           # type: Optional[np.ndarray]\n    affinities = None               # type: Optional[openTSNE.affinity.Affinities]\n    tsne_embedding = None           # type: Optional[manifold.TSNEModel]\n    iterations_done = 0             # type: int\n\n    # These attributes need not be set by the widget\n    tsne = None                     # type: Optional[manifold.TSNE]\n    # `effective_data` stores the current working matrix which should be used\n    # for any steps depending on the data matrix. For instance, normalization\n    # should use the effective data (presumably the original data), and set it\n    # to the normalized version upon completion. This can then later be used for\n    # PCA preprocessing\n    effective_data = None           # type: Optional[Table]\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        # Set `effective_data` to data if data provided, and effective data\n        # not provided\n        if self.effective_data is None and self.data is not None:\n            self.effective_data = self.data\n\n\ndef data_normalization(data):\n    normalization = preprocess.Normalize()\n    return normalization(data)\n\n\ndef pca_preprocessing(data, n_components):\n    projector = PCA(n_components=n_components, random_state=0)\n    model = projector(data)\n    return model(data)\n\n\ndef prepare_tsne_obj(data, perplexity, multiscale, exaggeration):\n    # type: (Table, float, bool, float) -> manifold.TSNE\n    \"\"\"Automatically determine the best parameters for the given data set.\"\"\"\n    # Compute perplexity settings for multiscale\n    n_samples = data.X.shape[0]\n    if multiscale:\n        perplexity = min((n_samples - 1) / 3, 50), min((n_samples - 1) / 3, 500)\n    else:\n        perplexity = perplexity\n\n    return manifold.TSNE(\n        n_components=2,\n        perplexity=perplexity,\n        multiscale=multiscale,\n        exaggeration=exaggeration,\n        random_state=0,\n    )\n\n\nclass TSNERunner:\n    @staticmethod\n    def compute_normalization(task: Task, state: TaskState, **_) -> None:\n        state.set_status(\"Normalizing data...\")\n        task.normalized_data = data_normalization(task.effective_data)\n        task.effective_data = task.normalized_data\n        state.set_partial_result((\"normalized_data\", task))\n\n    @staticmethod\n    def compute_pca(task: Task, state: TaskState, **_) -> None:\n        # Perform PCA preprocessing\n        state.set_status(\"Computing PCA...\")\n        pca_projection = pca_preprocessing(task.effective_data, task.pca_components)\n        # Apply t-SNE's preprocessors to the data\n        task.pca_projection = task.tsne.preprocess(pca_projection)\n        task.effective_data = task.pca_projection\n        state.set_partial_result((\"pca_projection\", task))\n\n    @staticmethod\n    def compute_initialization(task: Task, state: TaskState, **_) -> None:\n        # Prepare initial positions for t-SNE\n        state.set_status(\"Preparing initialization...\")\n        task.initialization = task.tsne.compute_initialization(task.effective_data.X)\n        state.set_partial_result((\"initialization\", task))\n\n    @staticmethod\n    def compute_affinities(task: Task, state: TaskState, **_) -> None:\n        # Compute affinities\n        state.set_status(\"Finding nearest neighbors...\")\n        task.affinities = task.tsne.compute_affinities(task.effective_data.X)\n        state.set_partial_result((\"affinities\", task))\n\n    @staticmethod\n    def compute_tsne(task: Task, state: TaskState, progress_callback=None) -> None:\n        tsne = task.tsne\n\n        state.set_status(\"Running optimization...\")\n\n        # If this the first time we're computing t-SNE (otherwise we may just\n        # be resuming optimization), we have to assemble the tsne object\n        if task.tsne_embedding is None:\n            # Assemble a t-SNE embedding object and convert it to a TSNEModel\n            task.tsne_embedding = tsne.prepare_embedding(\n                task.affinities, task.initialization\n            )\n            task.tsne_embedding = tsne.convert_embedding_to_model(\n                task.effective_data, task.tsne_embedding\n            )\n            state.set_partial_result((\"tsne_embedding\", task))\n\n            if state.is_interruption_requested():\n                return\n\n        total_iterations_needed = tsne.early_exaggeration_iter + tsne.n_iter\n\n        def run_optimization(tsne_params: dict, iterations_needed: int) -> bool:\n            \"\"\"Run t-SNE optimization phase. Return value indicates whether the\n            optimization was interrupted.\"\"\"\n            while task.iterations_done < iterations_needed:\n                # Step size can't be larger than the remaining number of iterations\n                step_size = min(_STEP_SIZE, iterations_needed - task.iterations_done)\n                task.tsne_embedding = task.tsne_embedding.optimize(\n                    step_size, **tsne_params\n                )\n                task.iterations_done += step_size\n                state.set_partial_result((\"tsne_embedding\", task))\n                if progress_callback is not None:\n                    # The current iterations must be divided by the total\n                    # number of iterations, not the number of iterations in the\n                    # current phase (iterations_needed)\n                    progress_callback(task.iterations_done / total_iterations_needed)\n\n                if state.is_interruption_requested():\n                    return True\n\n        # Run early exaggeration phase\n        was_interrupted = run_optimization(\n            dict(exaggeration=tsne.early_exaggeration, momentum=0.8, inplace=False),\n            iterations_needed=tsne.early_exaggeration_iter,\n        )\n        if was_interrupted:\n            return\n        # Run regular optimization phase\n        run_optimization(\n            dict(exaggeration=tsne.exaggeration, momentum=0.8, inplace=False),\n            iterations_needed=total_iterations_needed,\n        )\n\n    @classmethod\n    def run(cls, task: Task, state: TaskState) -> Task:\n        # Assign weights to each job indicating how much time will be spent on each\n        weights = {\"normalization\": 1, \"pca\": 1, \"init\": 1, \"aff\": 25, \"tsne\": 50}\n        total_weight = sum(weights.values())\n\n        # Prepare the tsne object and add it to the spec\n        task.tsne = prepare_tsne_obj(\n            task.data, task.perplexity, task.multiscale, task.exaggeration\n        )\n\n        job_queue = []\n        # Add the tasks that still need to be run to the job queue\n        task.effective_data = task.data\n\n        if task.normalize and task.normalized_data is None:\n            job_queue.append((cls.compute_normalization, weights[\"normalization\"]))\n\n        if task.use_pca_preprocessing and task.pca_projection is None:\n            job_queue.append((cls.compute_pca, weights[\"pca\"]))\n\n        if task.initialization is None:\n            job_queue.append((cls.compute_initialization, weights[\"init\"]))\n\n        if task.affinities is None:\n            job_queue.append((cls.compute_affinities, weights[\"aff\"]))\n\n        total_iterations = task.tsne.early_exaggeration_iter + task.tsne.n_iter\n        if task.tsne_embedding is None or task.iterations_done < total_iterations:\n            job_queue.append((cls.compute_tsne, weights[\"tsne\"]))\n\n        job_queue = [(partial(f, task, state), w) for f, w in job_queue]\n\n        # Ensure the effective data is set to the appropriate, potentially\n        # precomputed matrix\n        task.effective_data = task.data\n        if task.normalize and task.normalized_data is not None:\n            task.effective_data = task.normalized_data\n        if task.use_pca_preprocessing and task.pca_projection is not None:\n            task.effective_data = task.pca_projection\n\n        # Figure out the total weight of the jobs\n        job_weight = sum(j[1] for j in job_queue)\n        progress_done = total_weight - job_weight\n        for job, job_weight in job_queue:\n\n            def _progress_callback(val):\n                state.set_progress_value(\n                    (progress_done + val * job_weight) / total_weight * 100\n                )\n\n            if state.is_interruption_requested():\n                return task\n\n            # Execute the job\n            job(progress_callback=_progress_callback)\n            # Update the progress bar according to the weights assigned to\n            # each job\n            progress_done += job_weight\n            state.set_progress_value(progress_done / total_weight * 100)\n\n        return task\n\n\nclass OWtSNEGraph(OWScatterPlotBase):\n    def update_coordinates(self):\n        super().update_coordinates()\n        if self.scatterplot_item is not None:\n            self.view_box.setAspectLocked(True, 1)\n\n\nclass invalidated:\n    # pylint: disable=invalid-name\n    normalized_data = pca_projection = affinities = tsne_embedding = False\n\n    def __set__(self, instance, value):\n        # `self._invalidate = True` should invalidate everything\n        self.normalized_data = value\n        self.pca_projection = value\n        self.affinities = value\n        self.tsne_embedding = value\n\n    def __bool__(self):\n        # If any of the values are invalidated, this should return true\n        return (\n            self.normalized_data or self.pca_projection or self.affinities or\n            self.tsne_embedding\n        )\n\n    def __str__(self):\n        return \"%s(%s)\" % (self.__class__.__name__, \", \".join(\n            \"=\".join([k, str(getattr(self, k))])\n            for k in [\"normalized_data\", \"pca_projection\", \"affinities\",\n                      \"tsne_embedding\"]\n        ))\n\n\nclass OWtSNE(OWDataProjectionWidget, ConcurrentWidgetMixin):\n    name = \"t-SNE\"\n    description = \"Two-dimensional data projection with t-SNE.\"\n    icon = \"icons/TSNE.svg\"\n    priority = 920\n    keywords = \"t-sne, tsne\"\n\n    settings_version = 4\n    perplexity = ContextSetting(30)\n    multiscale = ContextSetting(False)\n    exaggeration = ContextSetting(1)\n\n    normalize = ContextSetting(True)\n    use_pca_preprocessing = ContextSetting(True)\n    pca_components = ContextSetting(_DEFAULT_PCA_COMPONENTS)\n\n    GRAPH_CLASS = OWtSNEGraph\n    graph = SettingProvider(OWtSNEGraph)\n    embedding_variables_names = (\"t-SNE-x\", \"t-SNE-y\")\n\n    # Use `invalidated` descriptor, so we don't break the usage of\n    # `_invalidated` in `OWDataProjectionWidget`, but still allow finer control\n    # over which parts of the embedding to invalidate\n    _invalidated = invalidated()\n\n    class Information(OWDataProjectionWidget.Information):\n        modified = Msg(\"The parameter settings have been changed. Press \"\n                       \"\\\"Start\\\" to rerun with the new settings.\")\n\n    class Error(OWDataProjectionWidget.Error):\n        not_enough_rows = Msg(\"Input data needs at least 2 rows\")\n        not_enough_cols = Msg(\"Input data needs at least 2 attributes\")\n        constant_data = Msg(\"Input data is constant\")\n        no_valid_data = Msg(\"No projection due to no valid data\")\n\n    def __init__(self):\n        OWDataProjectionWidget.__init__(self)\n        ConcurrentWidgetMixin.__init__(self)\n        # Intermediate results\n        self.normalized_data = None       # type: Optional[Table]\n        self.pca_projection = None        # type: Optional[Table]\n        self.initialization = None        # type: Optional[np.ndarray]\n        self.affinities = None            # type: Optional[openTSNE.affinity.Affinities]\n        self.tsne_embedding = None        # type: Optional[manifold.TSNEModel]\n        self.iterations_done = 0          # type: int\n\n    @property\n    def effective_data(self):\n        return self.data.transform(Domain(self.effective_variables))\n\n    def _add_controls(self):\n        self._add_controls_start_box()\n        super()._add_controls()\n\n    def _add_controls_start_box(self):\n        preprocessing_box = gui.vBox(self.controlArea, box=\"Preprocessing\")\n        self.normalize_cbx = gui.checkBox(\n            preprocessing_box, self, \"normalize\", \"Normalize data\",\n            callback=self._invalidate_normalized_data,\n        )\n        self.pca_preprocessing_cbx = gui.checkBox(\n            preprocessing_box, self, \"use_pca_preprocessing\", \"Preprocess using PCA\",\n            callback=self._pca_preprocessing_changed,\n        )\n        self.pca_component_slider = gui.hSlider(\n            preprocessing_box, self, \"pca_components\", label=\"PCA Components:\",\n            minValue=2, maxValue=_MAX_PCA_COMPONENTS, step=1,\n            callback=self._invalidate_pca_projection,\n        )\n\n        box = gui.vBox(self.controlArea, box=\"Parameters\")\n        form = QFormLayout(\n            labelAlignment=Qt.AlignLeft,\n            formAlignment=Qt.AlignLeft,\n            fieldGrowthPolicy=QFormLayout.AllNonFixedFieldsGrow,\n        )\n\n        self.perplexity_spin = gui.spin(\n            box, self, \"perplexity\", 1, 500, step=1, alignment=Qt.AlignRight,\n            callback=self._invalidate_affinities, addToLayout=False\n        )\n        self.controls.perplexity.setDisabled(self.multiscale)\n        form.addRow(\"Perplexity:\", self.perplexity_spin)\n        form.addRow(gui.checkBox(\n            box, self, \"multiscale\", label=\"Preserve global structure\",\n            callback=self._multiscale_changed, addToLayout=False\n        ))\n\n        sbe = gui.hBox(self.controlArea, False, addToLayout=False)\n        gui.hSlider(\n            sbe, self, \"exaggeration\", minValue=1, maxValue=4, step=1,\n            callback=self._invalidate_tsne_embedding,\n        )\n        form.addRow(\"Exaggeration:\", sbe)\n\n        box.layout().addLayout(form)\n\n        self.run_button = gui.button(box, self, \"Start\", callback=self._toggle_run)\n\n    # Control callbacks\n    def _normalize_data_changed(self):\n        self._invalidate_normalized_data()\n\n    def _pca_preprocessing_changed(self):\n        self.controls.pca_components.setEnabled(self.use_pca_preprocessing)\n        self._invalidate_pca_projection()\n\n    def _multiscale_changed(self):\n        self.controls.perplexity.setDisabled(self.multiscale)\n        self._invalidate_affinities()\n\n    # Invalidateion cascade\n    def _invalidate_normalized_data(self):\n        self._invalidated.normalized_data = True\n        self._invalidate_pca_projection()\n\n    def _invalidate_pca_projection(self):\n        self._invalidated.pca_projection = True\n        self._invalidate_affinities()\n\n    def _invalidate_affinities(self):\n        self._invalidated.affinities = True\n        self._invalidate_tsne_embedding()\n\n    def _invalidate_tsne_embedding(self):\n        self._invalidated.tsne_embedding = True\n        self._stop_running_task()\n        self._set_modified(True)\n\n    def _stop_running_task(self):\n        self.cancel()\n        self.run_button.setText(\"Start\")\n\n    def _set_modified(self, state):\n        \"\"\"Mark the widget (GUI) as containing modified state.\"\"\"\n        if self.data is None:\n            # Does not apply when we have no data\n            state = False\n        self.Information.modified(shown=state)\n\n    def check_data(self):\n        def error(err):\n            err()\n            self.data = None\n\n        # `super().check_data()` clears all messages, so we have to remember if\n        # it was shown\n        # pylint: disable=assignment-from-no-return\n        should_show_modified_message = self.Information.modified.is_shown()\n        super().check_data()\n\n        if self.data is None:\n            return\n\n        self.Information.modified(shown=should_show_modified_message)\n\n        if len(self.data) < 2:\n            error(self.Error.not_enough_rows)\n\n        elif len(self.data.domain.attributes) < 2:\n            error(self.Error.not_enough_cols)\n\n        elif not self.data.is_sparse():\n            if np.all(~np.isfinite(self.data.X)):\n                error(self.Error.no_valid_data)\n            else:\n                with warnings.catch_warnings():\n                    warnings.filterwarnings(\n                        \"ignore\", \"Degrees of freedom .*\", RuntimeWarning)\n                    if np.nan_to_num(np.nanstd(self.data.X, axis=0)).sum() \\\n                            == 0:\n                        error(self.Error.constant_data)\n\n    def get_embedding(self):\n        if self.tsne_embedding is None:\n            self.valid_data = None\n            return None\n\n        embedding = self.tsne_embedding.embedding.X\n        self.valid_data = np.ones(len(embedding), dtype=bool)\n        return embedding\n\n    def _toggle_run(self):\n        # If no data, there's nothing to do\n        if self.data is None:\n            return\n\n        # Pause task\n        if self.task is not None:\n            self.cancel()\n            self.run_button.setText(\"Resume\")\n            self.commit.deferred()\n        # Resume task\n        else:\n            self.run()\n\n    def handleNewSignals(self):\n        # We don't bother with the granular invalidation flags because\n        # `super().handleNewSignals` will just set all of them to False or will\n        # do nothing. However, it's important we remember its state because we\n        # won't call `run` if needed. `run` also relies on the state of\n        # `_invalidated` to properly set the intermediate values to None\n        prev_invalidated = bool(self._invalidated)\n        super().handleNewSignals()\n        self._invalidated = prev_invalidated\n\n        if self._invalidated:\n            self.run()\n\n    def init_attr_values(self):\n        super().init_attr_values()\n\n        if self.data is not None:\n            n_attrs = len(self.data.domain.attributes)\n            max_components = min(_MAX_PCA_COMPONENTS, n_attrs)\n        else:\n            max_components = _MAX_PCA_COMPONENTS\n\n        # We set this to the default number of components here so it resets\n        # properly, any previous settings will be restored from context\n        # settings a little later\n        self.controls.pca_components.setMaximum(max_components)\n        self.controls.pca_components.setValue(_DEFAULT_PCA_COMPONENTS)\n\n        self.exaggeration = 1\n\n    def enable_controls(self):\n        super().enable_controls()\n\n        if self.data is not None:\n            # PCA doesn't support normalization on sparse data, as this would\n            # require centering and normalizing the matrix\n            self.normalize_cbx.setDisabled(self.data.is_sparse())\n            if self.data.is_sparse():\n                self.normalize = False\n                self.normalize_cbx.setToolTip(\n                    \"Data normalization is not supported on sparse matrices.\"\n                )\n            else:\n                self.normalize_cbx.setToolTip(\"\")\n\n        # Disable the perplexity spin box if multiscale is turned on\n        self.controls.perplexity.setDisabled(self.multiscale)\n\n    def run(self):\n        # Reset invalidated values as indicated by the flags\n        if self._invalidated.pca_projection:\n            self.pca_projection = None\n        if self._invalidated.affinities:\n            self.affinities = None\n        if self._invalidated.tsne_embedding:\n            self.iterations_done = 0\n            self.tsne_embedding = None\n\n        self._set_modified(False)\n        self._invalidated = False\n\n        # When the data is invalid, it is set to `None` and an error is set,\n        # therefore it would be erroneous to clear the error here\n        if self.data is not None:\n            self.run_button.setText(\"Stop\")\n\n        # Cancel current running task\n        self.cancel()\n\n        if self.data is None:\n            return\n\n        task = Task(\n            data=self.data,\n            # Normalization\n            normalize=self.normalize,\n            normalized_data=self.normalized_data,\n            # PCA preprocessing\n            use_pca_preprocessing=self.use_pca_preprocessing,\n            pca_components=self.pca_components,\n            pca_projection=self.pca_projection,\n            # t-SNE parameters\n            perplexity=self.perplexity,\n            multiscale=self.multiscale,\n            exaggeration=self.exaggeration,\n            initialization=self.initialization,\n            affinities=self.affinities,\n            # Misc\n            tsne_embedding=self.tsne_embedding,\n            iterations_done=self.iterations_done,\n        )\n        return self.start(TSNERunner.run, task)\n\n    def __ensure_task_same_for_normalization(self, task: Task):\n        assert self.data is not None\n        assert task.normalize == self.normalize\n        if task.normalize:\n            assert isinstance(task.normalized_data, Table) and \\\n                len(task.normalized_data) == len(self.data)\n\n    def __ensure_task_same_for_pca(self, task: Task):\n        assert self.data is not None\n        assert task.use_pca_preprocessing == self.use_pca_preprocessing\n        if task.use_pca_preprocessing:\n            assert task.pca_components == self.pca_components\n            assert isinstance(task.pca_projection, Table) and \\\n                len(task.pca_projection) == len(self.data)\n\n    def __ensure_task_same_for_initialization(self, task: Task):\n        assert isinstance(task.initialization, np.ndarray) and \\\n            len(task.initialization) == len(self.data)\n\n    def __ensure_task_same_for_affinities(self, task: Task):\n        assert task.perplexity == self.perplexity\n        assert task.multiscale == self.multiscale\n\n    def __ensure_task_same_for_embedding(self, task: Task):\n        assert task.exaggeration == self.exaggeration\n        assert isinstance(task.tsne_embedding, manifold.TSNEModel) and \\\n            len(task.tsne_embedding.embedding) == len(self.data)\n\n    def on_partial_result(self, value):\n        # type: (Tuple[str, Task]) -> None\n        which, task = value\n\n        if which == \"normalized_data\":\n            self.__ensure_task_same_for_normalization(task)\n            self.normalized_data = task.normalized_data\n        elif which == \"pca_projection\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.pca_projection = task.pca_projection\n        elif which == \"initialization\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_initialization(task)\n            self.initialization = task.initialization\n        elif which == \"affinities\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_affinities(task)\n            self.affinities = task.affinities\n        elif which == \"tsne_embedding\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_initialization(task)\n            self.__ensure_task_same_for_affinities(task)\n            self.__ensure_task_same_for_embedding(task)\n\n            prev_embedding, self.tsne_embedding = self.tsne_embedding, task.tsne_embedding\n            self.iterations_done = task.iterations_done\n            # If this is the first partial result we've gotten, we've got to\n            # setup the plot\n            if prev_embedding is None:\n                self.setup_plot()\n            # Otherwise, just update the point positions\n            else:\n                self.graph.update_coordinates()\n                self.graph.update_density()\n        else:\n            raise RuntimeError(\n                \"Unrecognized partial result called with `%s`\" % which\n            )\n\n    def on_done(self, task):\n        # type: (Task) -> None\n        self.run_button.setText(\"Start\")\n        # NOTE: All of these have already been set by on_partial_result,\n        # we double check that they are aliases\n        if task.pca_projection is not None:\n            self.__ensure_task_same_for_pca(task)\n            assert task.pca_projection is self.pca_projection\n        if task.initialization is not None:\n            self.__ensure_task_same_for_initialization(task)\n            assert task.initialization is self.initialization\n        if task.affinities is not None:\n            assert task.affinities is self.affinities\n        if task.tsne_embedding is not None:\n            self.__ensure_task_same_for_embedding(task)\n            assert task.tsne_embedding is self.tsne_embedding\n\n        self.commit.deferred()\n\n    def _get_projection_data(self):\n        if self.data is None:\n            return None\n\n        data = self.data.transform(\n            Domain(\n                self.data.domain.attributes,\n                self.data.domain.class_vars,\n                self.data.domain.metas + self._get_projection_variables()\n            )\n        )\n        with data.unlocked(data.metas):\n            data.metas[:, -2:] = self.get_embedding()\n        if self.tsne_embedding is not None:\n            data.domain = Domain(\n                self.data.domain.attributes,\n                self.data.domain.class_vars,\n                self.data.domain.metas + self.tsne_embedding.domain.attributes,\n            )\n        return data\n\n    def clear(self):\n        \"\"\"Clear widget state. Note that this doesn't clear the data.\"\"\"\n        super().clear()\n        self.run_button.setText(\"Start\")\n        self.cancel()\n        self.normalized_data = None\n        self.pca_projection = None\n        self.initialization = None\n        self.affinities = None\n        self.tsne_embedding = None\n        self.iterations_done = 0\n\n    def onDeleteWidget(self):\n        self.clear()\n        self.data = None\n        self.shutdown()\n        super().onDeleteWidget()\n\n    @classmethod\n    def migrate_settings(cls, settings, version):\n        if version < 3:\n            if \"selection_indices\" in settings:\n                settings[\"selection\"] = settings[\"selection_indices\"]\n        if version < 4:\n            settings.pop(\"max_iter\", None)\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 3:\n            values = context.values\n            values[\"attr_color\"] = values[\"graph\"][\"attr_color\"]\n            values[\"attr_size\"] = values[\"graph\"][\"attr_size\"]\n            values[\"attr_shape\"] = values[\"graph\"][\"attr_shape\"]\n            values[\"attr_label\"] = values[\"graph\"][\"attr_label\"]\n\n\nif __name__ == \"__main__\":\n    import sys\n    data = Table(sys.argv[1] if len(sys.argv) > 1 else \"iris\")\n    WidgetPreview(OWtSNE).run(\n        set_data=data,\n        set_subset_data=data[np.random.choice(len(data), 10)],\n    )\n",
            "new_file_content": "import warnings\nfrom functools import partial\nfrom types import SimpleNamespace as namespace\nfrom typing import Optional  # pylint: disable=unused-import\n\nimport numpy as np\n\nfrom AnyQt.QtCore import Qt\nfrom AnyQt.QtWidgets import QFormLayout\n\nfrom Orange.data import Table, Domain\nfrom Orange.preprocess import preprocess\nfrom Orange.projection import PCA\nfrom Orange.projection import manifold\nfrom Orange.widgets import gui\nfrom Orange.widgets.settings import SettingProvider, ContextSetting\nfrom Orange.widgets.utils.concurrent import TaskState, ConcurrentWidgetMixin\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.visualize.owscatterplotgraph import OWScatterPlotBase\nfrom Orange.widgets.visualize.utils.widget import OWDataProjectionWidget\nfrom Orange.widgets.widget import Msg\n\n_STEP_SIZE = 25\n_MAX_PCA_COMPONENTS = 50\n_DEFAULT_PCA_COMPONENTS = 20\n\n\nclass Task(namespace):\n    \"\"\"Completely determines the t-SNE task spec and intermediate results.\"\"\"\n    data = None                     # type: Optional[Table]\n\n    normalize = None                # type: Optional[bool]\n    normalized_data = None          # type: Optional[Table]\n\n    use_pca_preprocessing = None    # type: Optional[bool]\n    pca_components = None           # type: Optional[int]\n    pca_projection = None           # type: Optional[Table]\n\n    perplexity = None               # type: Optional[float]\n    multiscale = None               # type: Optional[bool]\n    exaggeration = None             # type: Optional[float]\n    initialization = None           # type: Optional[np.ndarray]\n    affinities = None               # type: Optional[openTSNE.affinity.Affinities]\n    tsne_embedding = None           # type: Optional[manifold.TSNEModel]\n    iterations_done = 0             # type: int\n\n    # These attributes need not be set by the widget\n    tsne = None                     # type: Optional[manifold.TSNE]\n    # `effective_data` stores the current working matrix which should be used\n    # for any steps depending on the data matrix. For instance, normalization\n    # should use the effective data (presumably the original data), and set it\n    # to the normalized version upon completion. This can then later be used for\n    # PCA preprocessing\n    effective_data = None           # type: Optional[Table]\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        # Set `effective_data` to data if data provided, and effective data\n        # not provided\n        if self.effective_data is None and self.data is not None:\n            self.effective_data = self.data\n\n\ndef data_normalization(data):\n    normalization = preprocess.Normalize()\n    return normalization(data)\n\n\ndef pca_preprocessing(data, n_components):\n    projector = PCA(n_components=n_components, random_state=0)\n    model = projector(data)\n    return model(data)\n\n\ndef prepare_tsne_obj(data, perplexity, multiscale, exaggeration):\n    # type: (Table, float, bool, float) -> manifold.TSNE\n    \"\"\"Automatically determine the best parameters for the given data set.\"\"\"\n    # Compute perplexity settings for multiscale\n    n_samples = data.X.shape[0]\n    if multiscale:\n        perplexity = min((n_samples - 1) / 3, 50), min((n_samples - 1) / 3, 500)\n    else:\n        perplexity = perplexity\n\n    return manifold.TSNE(\n        n_components=2,\n        perplexity=perplexity,\n        multiscale=multiscale,\n        exaggeration=exaggeration,\n        random_state=0,\n    )\n\n\nclass TSNERunner:\n    @staticmethod\n    def compute_normalization(task: Task, state: TaskState, **_) -> None:\n        state.set_status(\"Normalizing data...\")\n        task.normalized_data = data_normalization(task.effective_data)\n        task.effective_data = task.normalized_data\n        state.set_partial_result((\"normalized_data\", task))\n\n    @staticmethod\n    def compute_pca(task: Task, state: TaskState, **_) -> None:\n        # Perform PCA preprocessing\n        state.set_status(\"Computing PCA...\")\n        pca_projection = pca_preprocessing(task.effective_data, task.pca_components)\n        # Apply t-SNE's preprocessors to the data\n        task.pca_projection = task.tsne.preprocess(pca_projection)\n        task.effective_data = task.pca_projection\n        state.set_partial_result((\"pca_projection\", task))\n\n    @staticmethod\n    def compute_initialization(task: Task, state: TaskState, **_) -> None:\n        # Prepare initial positions for t-SNE\n        state.set_status(\"Preparing initialization...\")\n        task.initialization = task.tsne.compute_initialization(task.effective_data.X)\n        state.set_partial_result((\"initialization\", task))\n\n    @staticmethod\n    def compute_affinities(task: Task, state: TaskState, **_) -> None:\n        # Compute affinities\n        state.set_status(\"Finding nearest neighbors...\")\n        task.affinities = task.tsne.compute_affinities(task.effective_data.X)\n        state.set_partial_result((\"affinities\", task))\n\n    @staticmethod\n    def compute_tsne(task: Task, state: TaskState, progress_callback=None) -> None:\n        tsne = task.tsne\n\n        state.set_status(\"Running optimization...\")\n\n        # If this the first time we're computing t-SNE (otherwise we may just\n        # be resuming optimization), we have to assemble the tsne object\n        if task.tsne_embedding is None:\n            # Assemble a t-SNE embedding object and convert it to a TSNEModel\n            task.tsne_embedding = tsne.prepare_embedding(\n                task.affinities, task.initialization\n            )\n            task.tsne_embedding = tsne.convert_embedding_to_model(\n                task.effective_data, task.tsne_embedding\n            )\n            state.set_partial_result((\"tsne_embedding\", task))\n\n            if state.is_interruption_requested():\n                return\n\n        total_iterations_needed = tsne.early_exaggeration_iter + tsne.n_iter\n\n        def run_optimization(tsne_params: dict, iterations_needed: int) -> bool:\n            \"\"\"Run t-SNE optimization phase. Return value indicates whether the\n            optimization was interrupted.\"\"\"\n            while task.iterations_done < iterations_needed:\n                # Step size can't be larger than the remaining number of iterations\n                step_size = min(_STEP_SIZE, iterations_needed - task.iterations_done)\n                task.tsne_embedding = task.tsne_embedding.optimize(\n                    step_size, **tsne_params\n                )\n                task.iterations_done += step_size\n                state.set_partial_result((\"tsne_embedding\", task))\n                if progress_callback is not None:\n                    # The current iterations must be divided by the total\n                    # number of iterations, not the number of iterations in the\n                    # current phase (iterations_needed)\n                    progress_callback(task.iterations_done / total_iterations_needed)\n\n                if state.is_interruption_requested():\n                    return True\n\n        # Run early exaggeration phase\n        was_interrupted = run_optimization(\n            dict(exaggeration=tsne.early_exaggeration, momentum=0.8, inplace=False),\n            iterations_needed=tsne.early_exaggeration_iter,\n        )\n        if was_interrupted:\n            return\n        # Run regular optimization phase\n        run_optimization(\n            dict(exaggeration=tsne.exaggeration, momentum=0.8, inplace=False),\n            iterations_needed=total_iterations_needed,\n        )\n\n    @classmethod\n    def run(cls, task: Task, state: TaskState) -> Task:\n        # Assign weights to each job indicating how much time will be spent on each\n        weights = {\"normalization\": 1, \"pca\": 1, \"init\": 1, \"aff\": 25, \"tsne\": 50}\n        total_weight = sum(weights.values())\n\n        # Prepare the tsne object and add it to the spec\n        task.tsne = prepare_tsne_obj(\n            task.data, task.perplexity, task.multiscale, task.exaggeration\n        )\n\n        job_queue = []\n        # Add the tasks that still need to be run to the job queue\n        task.effective_data = task.data\n\n        if task.normalize and task.normalized_data is None:\n            job_queue.append((cls.compute_normalization, weights[\"normalization\"]))\n\n        if task.use_pca_preprocessing and task.pca_projection is None:\n            job_queue.append((cls.compute_pca, weights[\"pca\"]))\n\n        if task.initialization is None:\n            job_queue.append((cls.compute_initialization, weights[\"init\"]))\n\n        if task.affinities is None:\n            job_queue.append((cls.compute_affinities, weights[\"aff\"]))\n\n        total_iterations = task.tsne.early_exaggeration_iter + task.tsne.n_iter\n        if task.tsne_embedding is None or task.iterations_done < total_iterations:\n            job_queue.append((cls.compute_tsne, weights[\"tsne\"]))\n\n        job_queue = [(partial(f, task, state), w) for f, w in job_queue]\n\n        # Ensure the effective data is set to the appropriate, potentially\n        # precomputed matrix\n        task.effective_data = task.data\n        if task.normalize and task.normalized_data is not None:\n            task.effective_data = task.normalized_data\n        if task.use_pca_preprocessing and task.pca_projection is not None:\n            task.effective_data = task.pca_projection\n\n        # Figure out the total weight of the jobs\n        job_weight = sum(j[1] for j in job_queue)\n        progress_done = total_weight - job_weight\n        for job, job_weight in job_queue:\n\n            def _progress_callback(val):\n                state.set_progress_value(\n                    (progress_done + val * job_weight) / total_weight * 100\n                )\n\n            if state.is_interruption_requested():\n                return task\n\n            # Execute the job\n            job(progress_callback=_progress_callback)\n            # Update the progress bar according to the weights assigned to\n            # each job\n            progress_done += job_weight\n            state.set_progress_value(progress_done / total_weight * 100)\n\n        return task\n\n\nclass OWtSNEGraph(OWScatterPlotBase):\n    def update_coordinates(self):\n        super().update_coordinates()\n        if self.scatterplot_item is not None:\n            self.view_box.setAspectLocked(True, 1)\n\n\nclass invalidated:\n    # pylint: disable=invalid-name\n    normalized_data = pca_projection = affinities = tsne_embedding = False\n\n    def __set__(self, instance, value):\n        # `self._invalidate = True` should invalidate everything\n        self.normalized_data = value\n        self.pca_projection = value\n        self.affinities = value\n        self.tsne_embedding = value\n\n    def __bool__(self):\n        # If any of the values are invalidated, this should return true\n        return (\n            self.normalized_data or self.pca_projection or self.affinities or\n            self.tsne_embedding\n        )\n\n    def __str__(self):\n        return \"%s(%s)\" % (self.__class__.__name__, \", \".join(\n            \"=\".join([k, str(getattr(self, k))])\n            for k in [\"normalized_data\", \"pca_projection\", \"affinities\",\n                      \"tsne_embedding\"]\n        ))\n\n\nclass OWtSNE(OWDataProjectionWidget, ConcurrentWidgetMixin):\n    name = \"t-SNE\"\n    description = \"Two-dimensional data projection with t-SNE.\"\n    icon = \"icons/TSNE.svg\"\n    priority = 920\n    keywords = \"t-sne, tsne\"\n\n    settings_version = 4\n    perplexity = ContextSetting(30)\n    multiscale = ContextSetting(False)\n    exaggeration = ContextSetting(1)\n\n    normalize = ContextSetting(True)\n    use_pca_preprocessing = ContextSetting(True)\n    pca_components = ContextSetting(_DEFAULT_PCA_COMPONENTS)\n\n    GRAPH_CLASS = OWtSNEGraph\n    graph = SettingProvider(OWtSNEGraph)\n    embedding_variables_names = (\"t-SNE-x\", \"t-SNE-y\")\n\n    # Use `invalidated` descriptor, so we don't break the usage of\n    # `_invalidated` in `OWDataProjectionWidget`, but still allow finer control\n    # over which parts of the embedding to invalidate\n    _invalidated = invalidated()\n\n    class Information(OWDataProjectionWidget.Information):\n        modified = Msg(\"The parameter settings have been changed. Press \"\n                       \"\\\"Start\\\" to rerun with the new settings.\")\n\n    class Warning(OWDataProjectionWidget.Warning):\n        consider_using_pca_preprocessing = Msg(\n            \"The input data contains a large number of features, which may slow\"\n            \" down t-SNE computation. Consider enabling PCA preprocessing.\"\n        )\n\n    class Error(OWDataProjectionWidget.Error):\n        not_enough_rows = Msg(\"Input data needs at least 2 rows\")\n        not_enough_cols = Msg(\"Input data needs at least 2 attributes\")\n        constant_data = Msg(\"Input data is constant\")\n        no_valid_data = Msg(\"No projection due to no valid data\")\n\n    def __init__(self):\n        OWDataProjectionWidget.__init__(self)\n        ConcurrentWidgetMixin.__init__(self)\n        # Intermediate results\n        self.normalized_data = None       # type: Optional[Table]\n        self.pca_projection = None        # type: Optional[Table]\n        self.initialization = None        # type: Optional[np.ndarray]\n        self.affinities = None            # type: Optional[openTSNE.affinity.Affinities]\n        self.tsne_embedding = None        # type: Optional[manifold.TSNEModel]\n        self.iterations_done = 0          # type: int\n\n    @property\n    def effective_data(self):\n        return self.data.transform(Domain(self.effective_variables))\n\n    def _add_controls(self):\n        self._add_controls_start_box()\n        super()._add_controls()\n\n    def _add_controls_start_box(self):\n        preprocessing_box = gui.vBox(self.controlArea, box=\"Preprocessing\")\n        self.normalize_cbx = gui.checkBox(\n            preprocessing_box, self, \"normalize\", \"Normalize data\",\n            callback=self._invalidate_normalized_data,\n        )\n        self.pca_preprocessing_cbx = gui.checkBox(\n            preprocessing_box, self, \"use_pca_preprocessing\", \"Preprocess using PCA\",\n            callback=self._pca_preprocessing_changed,\n        )\n        self.pca_component_slider = gui.hSlider(\n            preprocessing_box, self, \"pca_components\", label=\"PCA Components:\",\n            minValue=2, maxValue=_MAX_PCA_COMPONENTS, step=1,\n            callback=self._invalidate_pca_projection,\n        )\n\n        box = gui.vBox(self.controlArea, box=\"Parameters\")\n        form = QFormLayout(\n            labelAlignment=Qt.AlignLeft,\n            formAlignment=Qt.AlignLeft,\n            fieldGrowthPolicy=QFormLayout.AllNonFixedFieldsGrow,\n        )\n\n        self.perplexity_spin = gui.spin(\n            box, self, \"perplexity\", 1, 500, step=1, alignment=Qt.AlignRight,\n            callback=self._invalidate_affinities, addToLayout=False\n        )\n        self.controls.perplexity.setDisabled(self.multiscale)\n        form.addRow(\"Perplexity:\", self.perplexity_spin)\n        form.addRow(gui.checkBox(\n            box, self, \"multiscale\", label=\"Preserve global structure\",\n            callback=self._multiscale_changed, addToLayout=False\n        ))\n\n        sbe = gui.hBox(self.controlArea, False, addToLayout=False)\n        gui.hSlider(\n            sbe, self, \"exaggeration\", minValue=1, maxValue=4, step=1,\n            callback=self._invalidate_tsne_embedding,\n        )\n        form.addRow(\"Exaggeration:\", sbe)\n\n        box.layout().addLayout(form)\n\n        self.run_button = gui.button(box, self, \"Start\", callback=self._toggle_run)\n\n    # Control callbacks\n    def _normalize_data_changed(self):\n        self._invalidate_normalized_data()\n\n    def _pca_preprocessing_changed(self):\n        self.controls.pca_components.setEnabled(self.use_pca_preprocessing)\n        self._invalidate_pca_projection()\n\n        should_warn_pca = False\n        if self.data is not None and not self.use_pca_preprocessing:\n            if len(self.data.domain.attributes) >= _MAX_PCA_COMPONENTS:\n                should_warn_pca = True\n        self.Warning.consider_using_pca_preprocessing(shown=should_warn_pca)\n\n    def _multiscale_changed(self):\n        self.controls.perplexity.setDisabled(self.multiscale)\n        self._invalidate_affinities()\n\n    # Invalidateion cascade\n    def _invalidate_normalized_data(self):\n        self._invalidated.normalized_data = True\n        self._invalidate_pca_projection()\n\n    def _invalidate_pca_projection(self):\n        self._invalidated.pca_projection = True\n        self._invalidate_affinities()\n\n    def _invalidate_affinities(self):\n        self._invalidated.affinities = True\n        self._invalidate_tsne_embedding()\n\n    def _invalidate_tsne_embedding(self):\n        self._invalidated.tsne_embedding = True\n        self._stop_running_task()\n        self._set_modified(True)\n\n    def _stop_running_task(self):\n        self.cancel()\n        self.run_button.setText(\"Start\")\n\n    def _set_modified(self, state):\n        \"\"\"Mark the widget (GUI) as containing modified state.\"\"\"\n        if self.data is None:\n            # Does not apply when we have no data\n            state = False\n        self.Information.modified(shown=state)\n\n    def check_data(self):\n        def error(err):\n            err()\n            self.data = None\n\n        # `super().check_data()` clears all messages, so we have to remember if\n        # it was shown\n        # pylint: disable=assignment-from-no-return\n        should_show_modified_message = self.Information.modified.is_shown()\n        super().check_data()\n\n        if self.data is None:\n            return\n\n        self.Information.modified(shown=should_show_modified_message)\n\n        if len(self.data) < 2:\n            error(self.Error.not_enough_rows)\n\n        elif len(self.data.domain.attributes) < 2:\n            error(self.Error.not_enough_cols)\n\n        elif not self.data.is_sparse():\n            if np.all(~np.isfinite(self.data.X)):\n                error(self.Error.no_valid_data)\n            else:\n                with warnings.catch_warnings():\n                    warnings.filterwarnings(\n                        \"ignore\", \"Degrees of freedom .*\", RuntimeWarning)\n                    if np.nan_to_num(np.nanstd(self.data.X, axis=0)).sum() \\\n                            == 0:\n                        error(self.Error.constant_data)\n\n    def get_embedding(self):\n        if self.tsne_embedding is None:\n            self.valid_data = None\n            return None\n\n        embedding = self.tsne_embedding.embedding.X\n        self.valid_data = np.ones(len(embedding), dtype=bool)\n        return embedding\n\n    def _toggle_run(self):\n        # If no data, there's nothing to do\n        if self.data is None:\n            return\n\n        # Pause task\n        if self.task is not None:\n            self.cancel()\n            self.run_button.setText(\"Resume\")\n            self.commit.deferred()\n        # Resume task\n        else:\n            self.run()\n\n    def handleNewSignals(self):\n        # We don't bother with the granular invalidation flags because\n        # `super().handleNewSignals` will just set all of them to False or will\n        # do nothing. However, it's important we remember its state because we\n        # won't call `run` if needed. `run` also relies on the state of\n        # `_invalidated` to properly set the intermediate values to None\n        prev_invalidated = bool(self._invalidated)\n        super().handleNewSignals()\n        self._invalidated = prev_invalidated\n\n        if self._invalidated:\n            self.run()\n\n    def init_attr_values(self):\n        super().init_attr_values()\n\n        if self.data is not None:\n            n_attrs = len(self.data.domain.attributes)\n            max_components = min(_MAX_PCA_COMPONENTS, n_attrs)\n        else:\n            max_components = _MAX_PCA_COMPONENTS\n\n        # We set this to the default number of components here so it resets\n        # properly, any previous settings will be restored from context\n        # settings a little later\n        self.controls.pca_components.setMaximum(max_components)\n        self.controls.pca_components.setValue(_DEFAULT_PCA_COMPONENTS)\n\n        self.exaggeration = 1\n\n    def enable_controls(self):\n        super().enable_controls()\n\n        if self.data is not None:\n            # PCA doesn't support normalization on sparse data, as this would\n            # require centering and normalizing the matrix\n            self.normalize_cbx.setDisabled(self.data.is_sparse())\n            if self.data.is_sparse():\n                self.normalize = False\n                self.normalize_cbx.setToolTip(\n                    \"Data normalization is not supported on sparse matrices.\"\n                )\n            else:\n                self.normalize_cbx.setToolTip(\"\")\n\n        # Disable the perplexity spin box if multiscale is turned on\n        self.controls.perplexity.setDisabled(self.multiscale)\n\n    def run(self):\n        # Reset invalidated values as indicated by the flags\n        if self._invalidated.pca_projection:\n            self.pca_projection = None\n        if self._invalidated.affinities:\n            self.affinities = None\n        if self._invalidated.tsne_embedding:\n            self.iterations_done = 0\n            self.tsne_embedding = None\n\n        self._set_modified(False)\n        self._invalidated = False\n\n        # When the data is invalid, it is set to `None` and an error is set,\n        # therefore it would be erroneous to clear the error here\n        if self.data is not None:\n            self.run_button.setText(\"Stop\")\n\n        # Cancel current running task\n        self.cancel()\n\n        if self.data is None:\n            return\n\n        task = Task(\n            data=self.data,\n            # Normalization\n            normalize=self.normalize,\n            normalized_data=self.normalized_data,\n            # PCA preprocessing\n            use_pca_preprocessing=self.use_pca_preprocessing,\n            pca_components=self.pca_components,\n            pca_projection=self.pca_projection,\n            # t-SNE parameters\n            perplexity=self.perplexity,\n            multiscale=self.multiscale,\n            exaggeration=self.exaggeration,\n            initialization=self.initialization,\n            affinities=self.affinities,\n            # Misc\n            tsne_embedding=self.tsne_embedding,\n            iterations_done=self.iterations_done,\n        )\n        return self.start(TSNERunner.run, task)\n\n    def __ensure_task_same_for_normalization(self, task: Task):\n        assert self.data is not None\n        assert task.normalize == self.normalize\n        if task.normalize:\n            assert isinstance(task.normalized_data, Table) and \\\n                len(task.normalized_data) == len(self.data)\n\n    def __ensure_task_same_for_pca(self, task: Task):\n        assert self.data is not None\n        assert task.use_pca_preprocessing == self.use_pca_preprocessing\n        if task.use_pca_preprocessing:\n            assert task.pca_components == self.pca_components\n            assert isinstance(task.pca_projection, Table) and \\\n                len(task.pca_projection) == len(self.data)\n\n    def __ensure_task_same_for_initialization(self, task: Task):\n        assert isinstance(task.initialization, np.ndarray) and \\\n            len(task.initialization) == len(self.data)\n\n    def __ensure_task_same_for_affinities(self, task: Task):\n        assert task.perplexity == self.perplexity\n        assert task.multiscale == self.multiscale\n\n    def __ensure_task_same_for_embedding(self, task: Task):\n        assert task.exaggeration == self.exaggeration\n        assert isinstance(task.tsne_embedding, manifold.TSNEModel) and \\\n            len(task.tsne_embedding.embedding) == len(self.data)\n\n    def on_partial_result(self, value):\n        # type: (Tuple[str, Task]) -> None\n        which, task = value\n\n        if which == \"normalized_data\":\n            self.__ensure_task_same_for_normalization(task)\n            self.normalized_data = task.normalized_data\n        elif which == \"pca_projection\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.pca_projection = task.pca_projection\n        elif which == \"initialization\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_initialization(task)\n            self.initialization = task.initialization\n        elif which == \"affinities\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_affinities(task)\n            self.affinities = task.affinities\n        elif which == \"tsne_embedding\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_initialization(task)\n            self.__ensure_task_same_for_affinities(task)\n            self.__ensure_task_same_for_embedding(task)\n\n            prev_embedding, self.tsne_embedding = self.tsne_embedding, task.tsne_embedding\n            self.iterations_done = task.iterations_done\n            # If this is the first partial result we've gotten, we've got to\n            # setup the plot\n            if prev_embedding is None:\n                self.setup_plot()\n            # Otherwise, just update the point positions\n            else:\n                self.graph.update_coordinates()\n                self.graph.update_density()\n        else:\n            raise RuntimeError(\n                \"Unrecognized partial result called with `%s`\" % which\n            )\n\n    def on_done(self, task):\n        # type: (Task) -> None\n        self.run_button.setText(\"Start\")\n        # NOTE: All of these have already been set by on_partial_result,\n        # we double check that they are aliases\n        if task.pca_projection is not None:\n            self.__ensure_task_same_for_pca(task)\n            assert task.pca_projection is self.pca_projection\n        if task.initialization is not None:\n            self.__ensure_task_same_for_initialization(task)\n            assert task.initialization is self.initialization\n        if task.affinities is not None:\n            assert task.affinities is self.affinities\n        if task.tsne_embedding is not None:\n            self.__ensure_task_same_for_embedding(task)\n            assert task.tsne_embedding is self.tsne_embedding\n\n        self.commit.deferred()\n\n    def _get_projection_data(self):\n        if self.data is None:\n            return None\n\n        data = self.data.transform(\n            Domain(\n                self.data.domain.attributes,\n                self.data.domain.class_vars,\n                self.data.domain.metas + self._get_projection_variables()\n            )\n        )\n        with data.unlocked(data.metas):\n            data.metas[:, -2:] = self.get_embedding()\n        if self.tsne_embedding is not None:\n            data.domain = Domain(\n                self.data.domain.attributes,\n                self.data.domain.class_vars,\n                self.data.domain.metas + self.tsne_embedding.domain.attributes,\n            )\n        return data\n\n    def clear(self):\n        \"\"\"Clear widget state. Note that this doesn't clear the data.\"\"\"\n        super().clear()\n        self.run_button.setText(\"Start\")\n        self.cancel()\n        self.normalized_data = None\n        self.pca_projection = None\n        self.initialization = None\n        self.affinities = None\n        self.tsne_embedding = None\n        self.iterations_done = 0\n\n    def onDeleteWidget(self):\n        self.clear()\n        self.data = None\n        self.shutdown()\n        super().onDeleteWidget()\n\n    @classmethod\n    def migrate_settings(cls, settings, version):\n        if version < 3:\n            if \"selection_indices\" in settings:\n                settings[\"selection\"] = settings[\"selection_indices\"]\n        if version < 4:\n            settings.pop(\"max_iter\", None)\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 3:\n            values = context.values\n            values[\"attr_color\"] = values[\"graph\"][\"attr_color\"]\n            values[\"attr_size\"] = values[\"graph\"][\"attr_size\"]\n            values[\"attr_shape\"] = values[\"graph\"][\"attr_shape\"]\n            values[\"attr_label\"] = values[\"graph\"][\"attr_label\"]\n\n\nif __name__ == \"__main__\":\n    import sys\n    data = Table(sys.argv[1] if len(sys.argv) > 1 else \"iris\")\n    WidgetPreview(OWtSNE).run(\n        set_data=data,\n        set_subset_data=data[np.random.choice(len(data), 10)],\n    )\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/unsupervised/owtsne.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "ef9f3c31e",
                "new_commit_hash": "5bb8777ea",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/unsupervised/owtsne.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/unsupervised/owtsne.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 305,
                            "length": 6
                        },
                        "new_range": {
                            "start": 305,
                            "length": 12
                        },
                        "section": "class OWtSNE(OWDataProjectionWidget, ConcurrentWidgetMixin):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        modified = Msg(\"The parameter settings have been changed. Press \"",
                                "type": "context"
                            },
                            {
                                "content": "                       \"\\\"Start\\\" to rerun with the new settings.\")",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    class Warning(OWDataProjectionWidget.Warning):",
                                "type": "added"
                            },
                            {
                                "content": "        consider_using_pca_preprocessing = Msg(",
                                "type": "added"
                            },
                            {
                                "content": "            \"The input data contains a large number of features, which may slow\"",
                                "type": "added"
                            },
                            {
                                "content": "            \" down t-SNE computation. Consider enabling PCA preprocessing.\"",
                                "type": "added"
                            },
                            {
                                "content": "        )",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "    class Error(OWDataProjectionWidget.Error):",
                                "type": "context"
                            },
                            {
                                "content": "        not_enough_rows = Msg(\"Input data needs at least 2 rows\")",
                                "type": "context"
                            },
                            {
                                "content": "        not_enough_cols = Msg(\"Input data needs at least 2 attributes\")",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/unsupervised/owtsne.py",
                            "type": "class",
                            "name": "OWtSNE",
                            "content": "class OWtSNE(OWDataProjectionWidget, ConcurrentWidgetMixin):\n    name = \"t-SNE\"\n    description = \"Two-dimensional data projection with t-SNE.\"\n    icon = \"icons/TSNE.svg\"\n    priority = 920\n    keywords = \"t-sne, tsne\"\n\n    settings_version = 4\n    perplexity = ContextSetting(30)\n    multiscale = ContextSetting(False)\n    exaggeration = ContextSetting(1)\n\n    normalize = ContextSetting(True)\n    use_pca_preprocessing = ContextSetting(True)\n    pca_components = ContextSetting(_DEFAULT_PCA_COMPONENTS)\n\n    GRAPH_CLASS = OWtSNEGraph\n    graph = SettingProvider(OWtSNEGraph)\n    embedding_variables_names = (\"t-SNE-x\", \"t-SNE-y\")\n\n    # Use `invalidated` descriptor, so we don't break the usage of\n    # `_invalidated` in `OWDataProjectionWidget`, but still allow finer control\n    # over which parts of the embedding to invalidate\n    _invalidated = invalidated()\n\n    class Information(OWDataProjectionWidget.Information):\n        modified = Msg(\"The parameter settings have been changed. Press \"\n                       \"\\\"Start\\\" to rerun with the new settings.\")\n\n    class Warning(OWDataProjectionWidget.Warning):\n        consider_using_pca_preprocessing = Msg(\n            \"The input data contains a large number of features, which may slow\"\n            \" down t-SNE computation. Consider enabling PCA preprocessing.\"\n        )\n\n    class Error(OWDataProjectionWidget.Error):\n        not_enough_rows = Msg(\"Input data needs at least 2 rows\")\n        not_enough_cols = Msg(\"Input data needs at least 2 attributes\")\n        constant_data = Msg(\"Input data is constant\")\n        no_valid_data = Msg(\"No projection due to no valid data\")\n\n    def __init__(self):\n        OWDataProjectionWidget.__init__(self)\n        ConcurrentWidgetMixin.__init__(self)\n        # Intermediate results\n        self.normalized_data = None       # type: Optional[Table]\n        self.pca_projection = None        # type: Optional[Table]\n        self.initialization = None        # type: Optional[np.ndarray]\n        self.affinities = None            # type: Optional[openTSNE.affinity.Affinities]\n        self.tsne_embedding = None        # type: Optional[manifold.TSNEModel]\n        self.iterations_done = 0          # type: int\n\n    @property\n    def effective_data(self):\n        return self.data.transform(Domain(self.effective_variables))\n\n    def _add_controls(self):\n        self._add_controls_start_box()\n        super()._add_controls()\n\n    def _add_controls_start_box(self):\n        preprocessing_box = gui.vBox(self.controlArea, box=\"Preprocessing\")\n        self.normalize_cbx = gui.checkBox(\n            preprocessing_box, self, \"normalize\", \"Normalize data\",\n            callback=self._invalidate_normalized_data,\n        )\n        self.pca_preprocessing_cbx = gui.checkBox(\n            preprocessing_box, self, \"use_pca_preprocessing\", \"Preprocess using PCA\",\n            callback=self._pca_preprocessing_changed,\n        )\n        self.pca_component_slider = gui.hSlider(\n            preprocessing_box, self, \"pca_components\", label=\"PCA Components:\",\n            minValue=2, maxValue=_MAX_PCA_COMPONENTS, step=1,\n            callback=self._invalidate_pca_projection,\n        )\n\n        box = gui.vBox(self.controlArea, box=\"Parameters\")\n        form = QFormLayout(\n            labelAlignment=Qt.AlignLeft,\n            formAlignment=Qt.AlignLeft,\n            fieldGrowthPolicy=QFormLayout.AllNonFixedFieldsGrow,\n        )\n\n        self.perplexity_spin = gui.spin(\n            box, self, \"perplexity\", 1, 500, step=1, alignment=Qt.AlignRight,\n            callback=self._invalidate_affinities, addToLayout=False\n        )\n        self.controls.perplexity.setDisabled(self.multiscale)\n        form.addRow(\"Perplexity:\", self.perplexity_spin)\n        form.addRow(gui.checkBox(\n            box, self, \"multiscale\", label=\"Preserve global structure\",\n            callback=self._multiscale_changed, addToLayout=False\n        ))\n\n        sbe = gui.hBox(self.controlArea, False, addToLayout=False)\n        gui.hSlider(\n            sbe, self, \"exaggeration\", minValue=1, maxValue=4, step=1,\n            callback=self._invalidate_tsne_embedding,\n        )\n        form.addRow(\"Exaggeration:\", sbe)\n\n        box.layout().addLayout(form)\n\n        self.run_button = gui.button(box, self, \"Start\", callback=self._toggle_run)\n\n    # Control callbacks\n    def _normalize_data_changed(self):\n        self._invalidate_normalized_data()\n\n    def _pca_preprocessing_changed(self):\n        self.controls.pca_components.setEnabled(self.use_pca_preprocessing)\n        self._invalidate_pca_projection()\n\n        should_warn_pca = False\n        if self.data is not None and not self.use_pca_preprocessing:\n            if len(self.data.domain.attributes) >= _MAX_PCA_COMPONENTS:\n                should_warn_pca = True\n        self.Warning.consider_using_pca_preprocessing(shown=should_warn_pca)\n\n    def _multiscale_changed(self):\n        self.controls.perplexity.setDisabled(self.multiscale)\n        self._invalidate_affinities()\n\n    # Invalidateion cascade\n    def _invalidate_normalized_data(self):\n        self._invalidated.normalized_data = True\n        self._invalidate_pca_projection()\n\n    def _invalidate_pca_projection(self):\n        self._invalidated.pca_projection = True\n        self._invalidate_affinities()\n\n    def _invalidate_affinities(self):\n        self._invalidated.affinities = True\n        self._invalidate_tsne_embedding()\n\n    def _invalidate_tsne_embedding(self):\n        self._invalidated.tsne_embedding = True\n        self._stop_running_task()\n        self._set_modified(True)\n\n    def _stop_running_task(self):\n        self.cancel()\n        self.run_button.setText(\"Start\")\n\n    def _set_modified(self, state):\n        \"\"\"Mark the widget (GUI) as containing modified state.\"\"\"\n        if self.data is None:\n            # Does not apply when we have no data\n            state = False\n        self.Information.modified(shown=state)\n\n    def check_data(self):\n        def error(err):\n            err()\n            self.data = None\n\n        # `super().check_data()` clears all messages, so we have to remember if\n        # it was shown\n        # pylint: disable=assignment-from-no-return\n        should_show_modified_message = self.Information.modified.is_shown()\n        super().check_data()\n\n        if self.data is None:\n            return\n\n        self.Information.modified(shown=should_show_modified_message)\n\n        if len(self.data) < 2:\n            error(self.Error.not_enough_rows)\n\n        elif len(self.data.domain.attributes) < 2:\n            error(self.Error.not_enough_cols)\n\n        elif not self.data.is_sparse():\n            if np.all(~np.isfinite(self.data.X)):\n                error(self.Error.no_valid_data)\n            else:\n                with warnings.catch_warnings():\n                    warnings.filterwarnings(\n                        \"ignore\", \"Degrees of freedom .*\", RuntimeWarning)\n                    if np.nan_to_num(np.nanstd(self.data.X, axis=0)).sum() \\\n                            == 0:\n                        error(self.Error.constant_data)\n\n    def get_embedding(self):\n        if self.tsne_embedding is None:\n            self.valid_data = None\n            return None\n\n        embedding = self.tsne_embedding.embedding.X\n        self.valid_data = np.ones(len(embedding), dtype=bool)\n        return embedding\n\n    def _toggle_run(self):\n        # If no data, there's nothing to do\n        if self.data is None:\n            return\n\n        # Pause task\n        if self.task is not None:\n            self.cancel()\n            self.run_button.setText(\"Resume\")\n            self.commit.deferred()\n        # Resume task\n        else:\n            self.run()\n\n    def handleNewSignals(self):\n        # We don't bother with the granular invalidation flags because\n        # `super().handleNewSignals` will just set all of them to False or will\n        # do nothing. However, it's important we remember its state because we\n        # won't call `run` if needed. `run` also relies on the state of\n        # `_invalidated` to properly set the intermediate values to None\n        prev_invalidated = bool(self._invalidated)\n        super().handleNewSignals()\n        self._invalidated = prev_invalidated\n\n        if self._invalidated:\n            self.run()\n\n    def init_attr_values(self):\n        super().init_attr_values()\n\n        if self.data is not None:\n            n_attrs = len(self.data.domain.attributes)\n            max_components = min(_MAX_PCA_COMPONENTS, n_attrs)\n        else:\n            max_components = _MAX_PCA_COMPONENTS\n\n        # We set this to the default number of components here so it resets\n        # properly, any previous settings will be restored from context\n        # settings a little later\n        self.controls.pca_components.setMaximum(max_components)\n        self.controls.pca_components.setValue(_DEFAULT_PCA_COMPONENTS)\n\n        self.exaggeration = 1\n\n    def enable_controls(self):\n        super().enable_controls()\n\n        if self.data is not None:\n            # PCA doesn't support normalization on sparse data, as this would\n            # require centering and normalizing the matrix\n            self.normalize_cbx.setDisabled(self.data.is_sparse())\n            if self.data.is_sparse():\n                self.normalize = False\n                self.normalize_cbx.setToolTip(\n                    \"Data normalization is not supported on sparse matrices.\"\n                )\n            else:\n                self.normalize_cbx.setToolTip(\"\")\n\n        # Disable the perplexity spin box if multiscale is turned on\n        self.controls.perplexity.setDisabled(self.multiscale)\n\n    def run(self):\n        # Reset invalidated values as indicated by the flags\n        if self._invalidated.pca_projection:\n            self.pca_projection = None\n        if self._invalidated.affinities:\n            self.affinities = None\n        if self._invalidated.tsne_embedding:\n            self.iterations_done = 0\n            self.tsne_embedding = None\n\n        self._set_modified(False)\n        self._invalidated = False\n\n        # When the data is invalid, it is set to `None` and an error is set,\n        # therefore it would be erroneous to clear the error here\n        if self.data is not None:\n            self.run_button.setText(\"Stop\")\n\n        # Cancel current running task\n        self.cancel()\n\n        if self.data is None:\n            return\n\n        task = Task(\n            data=self.data,\n            # Normalization\n            normalize=self.normalize,\n            normalized_data=self.normalized_data,\n            # PCA preprocessing\n            use_pca_preprocessing=self.use_pca_preprocessing,\n            pca_components=self.pca_components,\n            pca_projection=self.pca_projection,\n            # t-SNE parameters\n            perplexity=self.perplexity,\n            multiscale=self.multiscale,\n            exaggeration=self.exaggeration,\n            initialization=self.initialization,\n            affinities=self.affinities,\n            # Misc\n            tsne_embedding=self.tsne_embedding,\n            iterations_done=self.iterations_done,\n        )\n        return self.start(TSNERunner.run, task)\n\n    def __ensure_task_same_for_normalization(self, task: Task):\n        assert self.data is not None\n        assert task.normalize == self.normalize\n        if task.normalize:\n            assert isinstance(task.normalized_data, Table) and \\\n                len(task.normalized_data) == len(self.data)\n\n    def __ensure_task_same_for_pca(self, task: Task):\n        assert self.data is not None\n        assert task.use_pca_preprocessing == self.use_pca_preprocessing\n        if task.use_pca_preprocessing:\n            assert task.pca_components == self.pca_components\n            assert isinstance(task.pca_projection, Table) and \\\n                len(task.pca_projection) == len(self.data)\n\n    def __ensure_task_same_for_initialization(self, task: Task):\n        assert isinstance(task.initialization, np.ndarray) and \\\n            len(task.initialization) == len(self.data)\n\n    def __ensure_task_same_for_affinities(self, task: Task):\n        assert task.perplexity == self.perplexity\n        assert task.multiscale == self.multiscale\n\n    def __ensure_task_same_for_embedding(self, task: Task):\n        assert task.exaggeration == self.exaggeration\n        assert isinstance(task.tsne_embedding, manifold.TSNEModel) and \\\n            len(task.tsne_embedding.embedding) == len(self.data)\n\n    def on_partial_result(self, value):\n        # type: (Tuple[str, Task]) -> None\n        which, task = value\n\n        if which == \"normalized_data\":\n            self.__ensure_task_same_for_normalization(task)\n            self.normalized_data = task.normalized_data\n        elif which == \"pca_projection\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.pca_projection = task.pca_projection\n        elif which == \"initialization\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_initialization(task)\n            self.initialization = task.initialization\n        elif which == \"affinities\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_affinities(task)\n            self.affinities = task.affinities\n        elif which == \"tsne_embedding\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_initialization(task)\n            self.__ensure_task_same_for_affinities(task)\n            self.__ensure_task_same_for_embedding(task)\n\n            prev_embedding, self.tsne_embedding = self.tsne_embedding, task.tsne_embedding\n            self.iterations_done = task.iterations_done\n            # If this is the first partial result we've gotten, we've got to\n            # setup the plot\n            if prev_embedding is None:\n                self.setup_plot()\n            # Otherwise, just update the point positions\n            else:\n                self.graph.update_coordinates()\n                self.graph.update_density()\n        else:\n            raise RuntimeError(\n                \"Unrecognized partial result called with `%s`\" % which\n            )\n\n    def on_done(self, task):\n        # type: (Task) -> None\n        self.run_button.setText(\"Start\")\n        # NOTE: All of these have already been set by on_partial_result,\n        # we double check that they are aliases\n        if task.pca_projection is not None:\n            self.__ensure_task_same_for_pca(task)\n            assert task.pca_projection is self.pca_projection\n        if task.initialization is not None:\n            self.__ensure_task_same_for_initialization(task)\n            assert task.initialization is self.initialization\n        if task.affinities is not None:\n            assert task.affinities is self.affinities\n        if task.tsne_embedding is not None:\n            self.__ensure_task_same_for_embedding(task)\n            assert task.tsne_embedding is self.tsne_embedding\n\n        self.commit.deferred()\n\n    def _get_projection_data(self):\n        if self.data is None:\n            return None\n\n        data = self.data.transform(\n            Domain(\n                self.data.domain.attributes,\n                self.data.domain.class_vars,\n                self.data.domain.metas + self._get_projection_variables()\n            )\n        )\n        with data.unlocked(data.metas):\n            data.metas[:, -2:] = self.get_embedding()\n        if self.tsne_embedding is not None:\n            data.domain = Domain(\n                self.data.domain.attributes,\n                self.data.domain.class_vars,\n                self.data.domain.metas + self.tsne_embedding.domain.attributes,\n            )\n        return data\n\n    def clear(self):\n        \"\"\"Clear widget state. Note that this doesn't clear the data.\"\"\"\n        super().clear()\n        self.run_button.setText(\"Start\")\n        self.cancel()\n        self.normalized_data = None\n        self.pca_projection = None\n        self.initialization = None\n        self.affinities = None\n        self.tsne_embedding = None\n        self.iterations_done = 0\n\n    def onDeleteWidget(self):\n        self.clear()\n        self.data = None\n        self.shutdown()\n        super().onDeleteWidget()\n\n    @classmethod\n    def migrate_settings(cls, settings, version):\n        if version < 3:\n            if \"selection_indices\" in settings:\n                settings[\"selection\"] = settings[\"selection_indices\"]\n        if version < 4:\n            settings.pop(\"max_iter\", None)\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 3:\n            values = context.values\n            values[\"attr_color\"] = values[\"graph\"][\"attr_color\"]\n            values[\"attr_size\"] = values[\"graph\"][\"attr_size\"]\n            values[\"attr_shape\"] = values[\"graph\"][\"attr_shape\"]\n            values[\"attr_label\"] = values[\"graph\"][\"attr_label\"]",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 279,
                            "end_lineno": 724,
                            "parent": null
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 383,
                            "length": 6
                        },
                        "new_range": {
                            "start": 389,
                            "length": 12
                        },
                        "section": "class OWtSNE(OWDataProjectionWidget, ConcurrentWidgetMixin):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        self.controls.pca_components.setEnabled(self.use_pca_preprocessing)",
                                "type": "context"
                            },
                            {
                                "content": "        self._invalidate_pca_projection()",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        should_warn_pca = False",
                                "type": "added"
                            },
                            {
                                "content": "        if self.data is not None and not self.use_pca_preprocessing:",
                                "type": "added"
                            },
                            {
                                "content": "            if len(self.data.domain.attributes) >= _MAX_PCA_COMPONENTS:",
                                "type": "added"
                            },
                            {
                                "content": "                should_warn_pca = True",
                                "type": "added"
                            },
                            {
                                "content": "        self.Warning.consider_using_pca_preprocessing(shown=should_warn_pca)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "    def _multiscale_changed(self):",
                                "type": "context"
                            },
                            {
                                "content": "        self.controls.perplexity.setDisabled(self.multiscale)",
                                "type": "context"
                            },
                            {
                                "content": "        self._invalidate_affinities()",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/unsupervised/owtsne.py",
                            "type": "class",
                            "name": "OWtSNE",
                            "content": "class OWtSNE(OWDataProjectionWidget, ConcurrentWidgetMixin):\n    name = \"t-SNE\"\n    description = \"Two-dimensional data projection with t-SNE.\"\n    icon = \"icons/TSNE.svg\"\n    priority = 920\n    keywords = \"t-sne, tsne\"\n\n    settings_version = 4\n    perplexity = ContextSetting(30)\n    multiscale = ContextSetting(False)\n    exaggeration = ContextSetting(1)\n\n    normalize = ContextSetting(True)\n    use_pca_preprocessing = ContextSetting(True)\n    pca_components = ContextSetting(_DEFAULT_PCA_COMPONENTS)\n\n    GRAPH_CLASS = OWtSNEGraph\n    graph = SettingProvider(OWtSNEGraph)\n    embedding_variables_names = (\"t-SNE-x\", \"t-SNE-y\")\n\n    # Use `invalidated` descriptor, so we don't break the usage of\n    # `_invalidated` in `OWDataProjectionWidget`, but still allow finer control\n    # over which parts of the embedding to invalidate\n    _invalidated = invalidated()\n\n    class Information(OWDataProjectionWidget.Information):\n        modified = Msg(\"The parameter settings have been changed. Press \"\n                       \"\\\"Start\\\" to rerun with the new settings.\")\n\n    class Warning(OWDataProjectionWidget.Warning):\n        consider_using_pca_preprocessing = Msg(\n            \"The input data contains a large number of features, which may slow\"\n            \" down t-SNE computation. Consider enabling PCA preprocessing.\"\n        )\n\n    class Error(OWDataProjectionWidget.Error):\n        not_enough_rows = Msg(\"Input data needs at least 2 rows\")\n        not_enough_cols = Msg(\"Input data needs at least 2 attributes\")\n        constant_data = Msg(\"Input data is constant\")\n        no_valid_data = Msg(\"No projection due to no valid data\")\n\n    def __init__(self):\n        OWDataProjectionWidget.__init__(self)\n        ConcurrentWidgetMixin.__init__(self)\n        # Intermediate results\n        self.normalized_data = None       # type: Optional[Table]\n        self.pca_projection = None        # type: Optional[Table]\n        self.initialization = None        # type: Optional[np.ndarray]\n        self.affinities = None            # type: Optional[openTSNE.affinity.Affinities]\n        self.tsne_embedding = None        # type: Optional[manifold.TSNEModel]\n        self.iterations_done = 0          # type: int\n\n    @property\n    def effective_data(self):\n        return self.data.transform(Domain(self.effective_variables))\n\n    def _add_controls(self):\n        self._add_controls_start_box()\n        super()._add_controls()\n\n    def _add_controls_start_box(self):\n        preprocessing_box = gui.vBox(self.controlArea, box=\"Preprocessing\")\n        self.normalize_cbx = gui.checkBox(\n            preprocessing_box, self, \"normalize\", \"Normalize data\",\n            callback=self._invalidate_normalized_data,\n        )\n        self.pca_preprocessing_cbx = gui.checkBox(\n            preprocessing_box, self, \"use_pca_preprocessing\", \"Preprocess using PCA\",\n            callback=self._pca_preprocessing_changed,\n        )\n        self.pca_component_slider = gui.hSlider(\n            preprocessing_box, self, \"pca_components\", label=\"PCA Components:\",\n            minValue=2, maxValue=_MAX_PCA_COMPONENTS, step=1,\n            callback=self._invalidate_pca_projection,\n        )\n\n        box = gui.vBox(self.controlArea, box=\"Parameters\")\n        form = QFormLayout(\n            labelAlignment=Qt.AlignLeft,\n            formAlignment=Qt.AlignLeft,\n            fieldGrowthPolicy=QFormLayout.AllNonFixedFieldsGrow,\n        )\n\n        self.perplexity_spin = gui.spin(\n            box, self, \"perplexity\", 1, 500, step=1, alignment=Qt.AlignRight,\n            callback=self._invalidate_affinities, addToLayout=False\n        )\n        self.controls.perplexity.setDisabled(self.multiscale)\n        form.addRow(\"Perplexity:\", self.perplexity_spin)\n        form.addRow(gui.checkBox(\n            box, self, \"multiscale\", label=\"Preserve global structure\",\n            callback=self._multiscale_changed, addToLayout=False\n        ))\n\n        sbe = gui.hBox(self.controlArea, False, addToLayout=False)\n        gui.hSlider(\n            sbe, self, \"exaggeration\", minValue=1, maxValue=4, step=1,\n            callback=self._invalidate_tsne_embedding,\n        )\n        form.addRow(\"Exaggeration:\", sbe)\n\n        box.layout().addLayout(form)\n\n        self.run_button = gui.button(box, self, \"Start\", callback=self._toggle_run)\n\n    # Control callbacks\n    def _normalize_data_changed(self):\n        self._invalidate_normalized_data()\n\n    def _pca_preprocessing_changed(self):\n        self.controls.pca_components.setEnabled(self.use_pca_preprocessing)\n        self._invalidate_pca_projection()\n\n        should_warn_pca = False\n        if self.data is not None and not self.use_pca_preprocessing:\n            if len(self.data.domain.attributes) >= _MAX_PCA_COMPONENTS:\n                should_warn_pca = True\n        self.Warning.consider_using_pca_preprocessing(shown=should_warn_pca)\n\n    def _multiscale_changed(self):\n        self.controls.perplexity.setDisabled(self.multiscale)\n        self._invalidate_affinities()\n\n    # Invalidateion cascade\n    def _invalidate_normalized_data(self):\n        self._invalidated.normalized_data = True\n        self._invalidate_pca_projection()\n\n    def _invalidate_pca_projection(self):\n        self._invalidated.pca_projection = True\n        self._invalidate_affinities()\n\n    def _invalidate_affinities(self):\n        self._invalidated.affinities = True\n        self._invalidate_tsne_embedding()\n\n    def _invalidate_tsne_embedding(self):\n        self._invalidated.tsne_embedding = True\n        self._stop_running_task()\n        self._set_modified(True)\n\n    def _stop_running_task(self):\n        self.cancel()\n        self.run_button.setText(\"Start\")\n\n    def _set_modified(self, state):\n        \"\"\"Mark the widget (GUI) as containing modified state.\"\"\"\n        if self.data is None:\n            # Does not apply when we have no data\n            state = False\n        self.Information.modified(shown=state)\n\n    def check_data(self):\n        def error(err):\n            err()\n            self.data = None\n\n        # `super().check_data()` clears all messages, so we have to remember if\n        # it was shown\n        # pylint: disable=assignment-from-no-return\n        should_show_modified_message = self.Information.modified.is_shown()\n        super().check_data()\n\n        if self.data is None:\n            return\n\n        self.Information.modified(shown=should_show_modified_message)\n\n        if len(self.data) < 2:\n            error(self.Error.not_enough_rows)\n\n        elif len(self.data.domain.attributes) < 2:\n            error(self.Error.not_enough_cols)\n\n        elif not self.data.is_sparse():\n            if np.all(~np.isfinite(self.data.X)):\n                error(self.Error.no_valid_data)\n            else:\n                with warnings.catch_warnings():\n                    warnings.filterwarnings(\n                        \"ignore\", \"Degrees of freedom .*\", RuntimeWarning)\n                    if np.nan_to_num(np.nanstd(self.data.X, axis=0)).sum() \\\n                            == 0:\n                        error(self.Error.constant_data)\n\n    def get_embedding(self):\n        if self.tsne_embedding is None:\n            self.valid_data = None\n            return None\n\n        embedding = self.tsne_embedding.embedding.X\n        self.valid_data = np.ones(len(embedding), dtype=bool)\n        return embedding\n\n    def _toggle_run(self):\n        # If no data, there's nothing to do\n        if self.data is None:\n            return\n\n        # Pause task\n        if self.task is not None:\n            self.cancel()\n            self.run_button.setText(\"Resume\")\n            self.commit.deferred()\n        # Resume task\n        else:\n            self.run()\n\n    def handleNewSignals(self):\n        # We don't bother with the granular invalidation flags because\n        # `super().handleNewSignals` will just set all of them to False or will\n        # do nothing. However, it's important we remember its state because we\n        # won't call `run` if needed. `run` also relies on the state of\n        # `_invalidated` to properly set the intermediate values to None\n        prev_invalidated = bool(self._invalidated)\n        super().handleNewSignals()\n        self._invalidated = prev_invalidated\n\n        if self._invalidated:\n            self.run()\n\n    def init_attr_values(self):\n        super().init_attr_values()\n\n        if self.data is not None:\n            n_attrs = len(self.data.domain.attributes)\n            max_components = min(_MAX_PCA_COMPONENTS, n_attrs)\n        else:\n            max_components = _MAX_PCA_COMPONENTS\n\n        # We set this to the default number of components here so it resets\n        # properly, any previous settings will be restored from context\n        # settings a little later\n        self.controls.pca_components.setMaximum(max_components)\n        self.controls.pca_components.setValue(_DEFAULT_PCA_COMPONENTS)\n\n        self.exaggeration = 1\n\n    def enable_controls(self):\n        super().enable_controls()\n\n        if self.data is not None:\n            # PCA doesn't support normalization on sparse data, as this would\n            # require centering and normalizing the matrix\n            self.normalize_cbx.setDisabled(self.data.is_sparse())\n            if self.data.is_sparse():\n                self.normalize = False\n                self.normalize_cbx.setToolTip(\n                    \"Data normalization is not supported on sparse matrices.\"\n                )\n            else:\n                self.normalize_cbx.setToolTip(\"\")\n\n        # Disable the perplexity spin box if multiscale is turned on\n        self.controls.perplexity.setDisabled(self.multiscale)\n\n    def run(self):\n        # Reset invalidated values as indicated by the flags\n        if self._invalidated.pca_projection:\n            self.pca_projection = None\n        if self._invalidated.affinities:\n            self.affinities = None\n        if self._invalidated.tsne_embedding:\n            self.iterations_done = 0\n            self.tsne_embedding = None\n\n        self._set_modified(False)\n        self._invalidated = False\n\n        # When the data is invalid, it is set to `None` and an error is set,\n        # therefore it would be erroneous to clear the error here\n        if self.data is not None:\n            self.run_button.setText(\"Stop\")\n\n        # Cancel current running task\n        self.cancel()\n\n        if self.data is None:\n            return\n\n        task = Task(\n            data=self.data,\n            # Normalization\n            normalize=self.normalize,\n            normalized_data=self.normalized_data,\n            # PCA preprocessing\n            use_pca_preprocessing=self.use_pca_preprocessing,\n            pca_components=self.pca_components,\n            pca_projection=self.pca_projection,\n            # t-SNE parameters\n            perplexity=self.perplexity,\n            multiscale=self.multiscale,\n            exaggeration=self.exaggeration,\n            initialization=self.initialization,\n            affinities=self.affinities,\n            # Misc\n            tsne_embedding=self.tsne_embedding,\n            iterations_done=self.iterations_done,\n        )\n        return self.start(TSNERunner.run, task)\n\n    def __ensure_task_same_for_normalization(self, task: Task):\n        assert self.data is not None\n        assert task.normalize == self.normalize\n        if task.normalize:\n            assert isinstance(task.normalized_data, Table) and \\\n                len(task.normalized_data) == len(self.data)\n\n    def __ensure_task_same_for_pca(self, task: Task):\n        assert self.data is not None\n        assert task.use_pca_preprocessing == self.use_pca_preprocessing\n        if task.use_pca_preprocessing:\n            assert task.pca_components == self.pca_components\n            assert isinstance(task.pca_projection, Table) and \\\n                len(task.pca_projection) == len(self.data)\n\n    def __ensure_task_same_for_initialization(self, task: Task):\n        assert isinstance(task.initialization, np.ndarray) and \\\n            len(task.initialization) == len(self.data)\n\n    def __ensure_task_same_for_affinities(self, task: Task):\n        assert task.perplexity == self.perplexity\n        assert task.multiscale == self.multiscale\n\n    def __ensure_task_same_for_embedding(self, task: Task):\n        assert task.exaggeration == self.exaggeration\n        assert isinstance(task.tsne_embedding, manifold.TSNEModel) and \\\n            len(task.tsne_embedding.embedding) == len(self.data)\n\n    def on_partial_result(self, value):\n        # type: (Tuple[str, Task]) -> None\n        which, task = value\n\n        if which == \"normalized_data\":\n            self.__ensure_task_same_for_normalization(task)\n            self.normalized_data = task.normalized_data\n        elif which == \"pca_projection\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.pca_projection = task.pca_projection\n        elif which == \"initialization\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_initialization(task)\n            self.initialization = task.initialization\n        elif which == \"affinities\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_affinities(task)\n            self.affinities = task.affinities\n        elif which == \"tsne_embedding\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_initialization(task)\n            self.__ensure_task_same_for_affinities(task)\n            self.__ensure_task_same_for_embedding(task)\n\n            prev_embedding, self.tsne_embedding = self.tsne_embedding, task.tsne_embedding\n            self.iterations_done = task.iterations_done\n            # If this is the first partial result we've gotten, we've got to\n            # setup the plot\n            if prev_embedding is None:\n                self.setup_plot()\n            # Otherwise, just update the point positions\n            else:\n                self.graph.update_coordinates()\n                self.graph.update_density()\n        else:\n            raise RuntimeError(\n                \"Unrecognized partial result called with `%s`\" % which\n            )\n\n    def on_done(self, task):\n        # type: (Task) -> None\n        self.run_button.setText(\"Start\")\n        # NOTE: All of these have already been set by on_partial_result,\n        # we double check that they are aliases\n        if task.pca_projection is not None:\n            self.__ensure_task_same_for_pca(task)\n            assert task.pca_projection is self.pca_projection\n        if task.initialization is not None:\n            self.__ensure_task_same_for_initialization(task)\n            assert task.initialization is self.initialization\n        if task.affinities is not None:\n            assert task.affinities is self.affinities\n        if task.tsne_embedding is not None:\n            self.__ensure_task_same_for_embedding(task)\n            assert task.tsne_embedding is self.tsne_embedding\n\n        self.commit.deferred()\n\n    def _get_projection_data(self):\n        if self.data is None:\n            return None\n\n        data = self.data.transform(\n            Domain(\n                self.data.domain.attributes,\n                self.data.domain.class_vars,\n                self.data.domain.metas + self._get_projection_variables()\n            )\n        )\n        with data.unlocked(data.metas):\n            data.metas[:, -2:] = self.get_embedding()\n        if self.tsne_embedding is not None:\n            data.domain = Domain(\n                self.data.domain.attributes,\n                self.data.domain.class_vars,\n                self.data.domain.metas + self.tsne_embedding.domain.attributes,\n            )\n        return data\n\n    def clear(self):\n        \"\"\"Clear widget state. Note that this doesn't clear the data.\"\"\"\n        super().clear()\n        self.run_button.setText(\"Start\")\n        self.cancel()\n        self.normalized_data = None\n        self.pca_projection = None\n        self.initialization = None\n        self.affinities = None\n        self.tsne_embedding = None\n        self.iterations_done = 0\n\n    def onDeleteWidget(self):\n        self.clear()\n        self.data = None\n        self.shutdown()\n        super().onDeleteWidget()\n\n    @classmethod\n    def migrate_settings(cls, settings, version):\n        if version < 3:\n            if \"selection_indices\" in settings:\n                settings[\"selection\"] = settings[\"selection_indices\"]\n        if version < 4:\n            settings.pop(\"max_iter\", None)\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 3:\n            values = context.values\n            values[\"attr_color\"] = values[\"graph\"][\"attr_color\"]\n            values[\"attr_size\"] = values[\"graph\"][\"attr_size\"]\n            values[\"attr_shape\"] = values[\"graph\"][\"attr_shape\"]\n            values[\"attr_label\"] = values[\"graph\"][\"attr_label\"]",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 279,
                            "end_lineno": 724,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/unsupervised/owtsne.py",
                            "type": "method",
                            "name": "OWtSNE._pca_preprocessing_changed",
                            "content": "class OWtSNE(OWDataProjectionWidget, ConcurrentWidgetMixin):\n    name = \"t-SNE\"\n    description = \"Two-dimensional data projection with t-SNE.\"\n    icon = \"icons/TSNE.svg\"\n    priority = 920\n    keywords = \"t-sne, tsne\"\n\n    settings_version = 4\n    perplexity = ContextSetting(30)\n    multiscale = ContextSetting(False)\n    exaggeration = ContextSetting(1)\n\n    normalize = ContextSetting(True)\n    use_pca_preprocessing = ContextSetting(True)\n    pca_components = ContextSetting(_DEFAULT_PCA_COMPONENTS)\n\n    GRAPH_CLASS = OWtSNEGraph\n    graph = SettingProvider(OWtSNEGraph)\n    embedding_variables_names = (\"t-SNE-x\", \"t-SNE-y\")\n\n    # Use `invalidated` descriptor, so we don't break the usage of\n    # `_invalidated` in `OWDataProjectionWidget`, but still allow finer control\n    # over which parts of the embedding to invalidate\n    _invalidated = invalidated()\n\n    class Information(OWDataProjectionWidget.Information):\n        modified = Msg(\"The parameter settings have been changed. Press \"\n                       \"\\\"Start\\\" to rerun with the new settings.\")\n\n    class Warning(OWDataProjectionWidget.Warning):\n        consider_using_pca_preprocessing = Msg(\n            \"The input data contains a large number of features, which may slow\"\n            \" down t-SNE computation. Consider enabling PCA preprocessing.\"\n        )\n\n    class Error(OWDataProjectionWidget.Error):\n        not_enough_rows = Msg(\"Input data needs at least 2 rows\")\n        not_enough_cols = Msg(\"Input data needs at least 2 attributes\")\n        constant_data = Msg(\"Input data is constant\")\n        no_valid_data = Msg(\"No projection due to no valid data\")\n\n    def __init__(self):\n        OWDataProjectionWidget.__init__(self)\n        ConcurrentWidgetMixin.__init__(self)\n        # Intermediate results\n        self.normalized_data = None       # type: Optional[Table]\n        self.pca_projection = None        # type: Optional[Table]\n        self.initialization = None        # type: Optional[np.ndarray]\n        self.affinities = None            # type: Optional[openTSNE.affinity.Affinities]\n        self.tsne_embedding = None        # type: Optional[manifold.TSNEModel]\n        self.iterations_done = 0          # type: int\n\n    @property\n    def effective_data(self):\n        return self.data.transform(Domain(self.effective_variables))\n\n    def _add_controls(self):\n        self._add_controls_start_box()\n        super()._add_controls()\n\n    def _add_controls_start_box(self):\n        preprocessing_box = gui.vBox(self.controlArea, box=\"Preprocessing\")\n        self.normalize_cbx = gui.checkBox(\n            preprocessing_box, self, \"normalize\", \"Normalize data\",\n            callback=self._invalidate_normalized_data,\n        )\n        self.pca_preprocessing_cbx = gui.checkBox(\n            preprocessing_box, self, \"use_pca_preprocessing\", \"Preprocess using PCA\",\n            callback=self._pca_preprocessing_changed,\n        )\n        self.pca_component_slider = gui.hSlider(\n            preprocessing_box, self, \"pca_components\", label=\"PCA Components:\",\n            minValue=2, maxValue=_MAX_PCA_COMPONENTS, step=1,\n            callback=self._invalidate_pca_projection,\n        )\n\n        box = gui.vBox(self.controlArea, box=\"Parameters\")\n        form = QFormLayout(\n            labelAlignment=Qt.AlignLeft,\n            formAlignment=Qt.AlignLeft,\n            fieldGrowthPolicy=QFormLayout.AllNonFixedFieldsGrow,\n        )\n\n        self.perplexity_spin = gui.spin(\n            box, self, \"perplexity\", 1, 500, step=1, alignment=Qt.AlignRight,\n            callback=self._invalidate_affinities, addToLayout=False\n        )\n        self.controls.perplexity.setDisabled(self.multiscale)\n        form.addRow(\"Perplexity:\", self.perplexity_spin)\n        form.addRow(gui.checkBox(\n            box, self, \"multiscale\", label=\"Preserve global structure\",\n            callback=self._multiscale_changed, addToLayout=False\n        ))\n\n        sbe = gui.hBox(self.controlArea, False, addToLayout=False)\n        gui.hSlider(\n            sbe, self, \"exaggeration\", minValue=1, maxValue=4, step=1,\n            callback=self._invalidate_tsne_embedding,\n        )\n        form.addRow(\"Exaggeration:\", sbe)\n\n        box.layout().addLayout(form)\n\n        self.run_button = gui.button(box, self, \"Start\", callback=self._toggle_run)\n\n    # Control callbacks\n    def _normalize_data_changed(self):\n        self._invalidate_normalized_data()\n\n    def _pca_preprocessing_changed(self):\n        self.controls.pca_components.setEnabled(self.use_pca_preprocessing)\n        self._invalidate_pca_projection()\n\n        should_warn_pca = False\n        if self.data is not None and not self.use_pca_preprocessing:\n            if len(self.data.domain.attributes) >= _MAX_PCA_COMPONENTS:\n                should_warn_pca = True\n        self.Warning.consider_using_pca_preprocessing(shown=should_warn_pca)\n\n    def _multiscale_changed(self):\n        self.controls.perplexity.setDisabled(self.multiscale)\n        self._invalidate_affinities()\n\n    # Invalidateion cascade\n    def _invalidate_normalized_data(self):\n        self._invalidated.normalized_data = True\n        self._invalidate_pca_projection()\n\n    def _invalidate_pca_projection(self):\n        self._invalidated.pca_projection = True\n        self._invalidate_affinities()\n\n    def _invalidate_affinities(self):\n        self._invalidated.affinities = True\n        self._invalidate_tsne_embedding()\n\n    def _invalidate_tsne_embedding(self):\n        self._invalidated.tsne_embedding = True\n        self._stop_running_task()\n        self._set_modified(True)\n\n    def _stop_running_task(self):\n        self.cancel()\n        self.run_button.setText(\"Start\")\n\n    def _set_modified(self, state):\n        \"\"\"Mark the widget (GUI) as containing modified state.\"\"\"\n        if self.data is None:\n            # Does not apply when we have no data\n            state = False\n        self.Information.modified(shown=state)\n\n    def check_data(self):\n        def error(err):\n            err()\n            self.data = None\n\n        # `super().check_data()` clears all messages, so we have to remember if\n        # it was shown\n        # pylint: disable=assignment-from-no-return\n        should_show_modified_message = self.Information.modified.is_shown()\n        super().check_data()\n\n        if self.data is None:\n            return\n\n        self.Information.modified(shown=should_show_modified_message)\n\n        if len(self.data) < 2:\n            error(self.Error.not_enough_rows)\n\n        elif len(self.data.domain.attributes) < 2:\n            error(self.Error.not_enough_cols)\n\n        elif not self.data.is_sparse():\n            if np.all(~np.isfinite(self.data.X)):\n                error(self.Error.no_valid_data)\n            else:\n                with warnings.catch_warnings():\n                    warnings.filterwarnings(\n                        \"ignore\", \"Degrees of freedom .*\", RuntimeWarning)\n                    if np.nan_to_num(np.nanstd(self.data.X, axis=0)).sum() \\\n                            == 0:\n                        error(self.Error.constant_data)\n\n    def get_embedding(self):\n        if self.tsne_embedding is None:\n            self.valid_data = None\n            return None\n\n        embedding = self.tsne_embedding.embedding.X\n        self.valid_data = np.ones(len(embedding), dtype=bool)\n        return embedding\n\n    def _toggle_run(self):\n        # If no data, there's nothing to do\n        if self.data is None:\n            return\n\n        # Pause task\n        if self.task is not None:\n            self.cancel()\n            self.run_button.setText(\"Resume\")\n            self.commit.deferred()\n        # Resume task\n        else:\n            self.run()\n\n    def handleNewSignals(self):\n        # We don't bother with the granular invalidation flags because\n        # `super().handleNewSignals` will just set all of them to False or will\n        # do nothing. However, it's important we remember its state because we\n        # won't call `run` if needed. `run` also relies on the state of\n        # `_invalidated` to properly set the intermediate values to None\n        prev_invalidated = bool(self._invalidated)\n        super().handleNewSignals()\n        self._invalidated = prev_invalidated\n\n        if self._invalidated:\n            self.run()\n\n    def init_attr_values(self):\n        super().init_attr_values()\n\n        if self.data is not None:\n            n_attrs = len(self.data.domain.attributes)\n            max_components = min(_MAX_PCA_COMPONENTS, n_attrs)\n        else:\n            max_components = _MAX_PCA_COMPONENTS\n\n        # We set this to the default number of components here so it resets\n        # properly, any previous settings will be restored from context\n        # settings a little later\n        self.controls.pca_components.setMaximum(max_components)\n        self.controls.pca_components.setValue(_DEFAULT_PCA_COMPONENTS)\n\n        self.exaggeration = 1\n\n    def enable_controls(self):\n        super().enable_controls()\n\n        if self.data is not None:\n            # PCA doesn't support normalization on sparse data, as this would\n            # require centering and normalizing the matrix\n            self.normalize_cbx.setDisabled(self.data.is_sparse())\n            if self.data.is_sparse():\n                self.normalize = False\n                self.normalize_cbx.setToolTip(\n                    \"Data normalization is not supported on sparse matrices.\"\n                )\n            else:\n                self.normalize_cbx.setToolTip(\"\")\n\n        # Disable the perplexity spin box if multiscale is turned on\n        self.controls.perplexity.setDisabled(self.multiscale)\n\n    def run(self):\n        # Reset invalidated values as indicated by the flags\n        if self._invalidated.pca_projection:\n            self.pca_projection = None\n        if self._invalidated.affinities:\n            self.affinities = None\n        if self._invalidated.tsne_embedding:\n            self.iterations_done = 0\n            self.tsne_embedding = None\n\n        self._set_modified(False)\n        self._invalidated = False\n\n        # When the data is invalid, it is set to `None` and an error is set,\n        # therefore it would be erroneous to clear the error here\n        if self.data is not None:\n            self.run_button.setText(\"Stop\")\n\n        # Cancel current running task\n        self.cancel()\n\n        if self.data is None:\n            return\n\n        task = Task(\n            data=self.data,\n            # Normalization\n            normalize=self.normalize,\n            normalized_data=self.normalized_data,\n            # PCA preprocessing\n            use_pca_preprocessing=self.use_pca_preprocessing,\n            pca_components=self.pca_components,\n            pca_projection=self.pca_projection,\n            # t-SNE parameters\n            perplexity=self.perplexity,\n            multiscale=self.multiscale,\n            exaggeration=self.exaggeration,\n            initialization=self.initialization,\n            affinities=self.affinities,\n            # Misc\n            tsne_embedding=self.tsne_embedding,\n            iterations_done=self.iterations_done,\n        )\n        return self.start(TSNERunner.run, task)\n\n    def __ensure_task_same_for_normalization(self, task: Task):\n        assert self.data is not None\n        assert task.normalize == self.normalize\n        if task.normalize:\n            assert isinstance(task.normalized_data, Table) and \\\n                len(task.normalized_data) == len(self.data)\n\n    def __ensure_task_same_for_pca(self, task: Task):\n        assert self.data is not None\n        assert task.use_pca_preprocessing == self.use_pca_preprocessing\n        if task.use_pca_preprocessing:\n            assert task.pca_components == self.pca_components\n            assert isinstance(task.pca_projection, Table) and \\\n                len(task.pca_projection) == len(self.data)\n\n    def __ensure_task_same_for_initialization(self, task: Task):\n        assert isinstance(task.initialization, np.ndarray) and \\\n            len(task.initialization) == len(self.data)\n\n    def __ensure_task_same_for_affinities(self, task: Task):\n        assert task.perplexity == self.perplexity\n        assert task.multiscale == self.multiscale\n\n    def __ensure_task_same_for_embedding(self, task: Task):\n        assert task.exaggeration == self.exaggeration\n        assert isinstance(task.tsne_embedding, manifold.TSNEModel) and \\\n            len(task.tsne_embedding.embedding) == len(self.data)\n\n    def on_partial_result(self, value):\n        # type: (Tuple[str, Task]) -> None\n        which, task = value\n\n        if which == \"normalized_data\":\n            self.__ensure_task_same_for_normalization(task)\n            self.normalized_data = task.normalized_data\n        elif which == \"pca_projection\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.pca_projection = task.pca_projection\n        elif which == \"initialization\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_initialization(task)\n            self.initialization = task.initialization\n        elif which == \"affinities\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_affinities(task)\n            self.affinities = task.affinities\n        elif which == \"tsne_embedding\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_initialization(task)\n            self.__ensure_task_same_for_affinities(task)\n            self.__ensure_task_same_for_embedding(task)\n\n            prev_embedding, self.tsne_embedding = self.tsne_embedding, task.tsne_embedding\n            self.iterations_done = task.iterations_done\n            # If this is the first partial result we've gotten, we've got to\n            # setup the plot\n            if prev_embedding is None:\n                self.setup_plot()\n            # Otherwise, just update the point positions\n            else:\n                self.graph.update_coordinates()\n                self.graph.update_density()\n        else:\n            raise RuntimeError(\n                \"Unrecognized partial result called with `%s`\" % which\n            )\n\n    def on_done(self, task):\n        # type: (Task) -> None\n        self.run_button.setText(\"Start\")\n        # NOTE: All of these have already been set by on_partial_result,\n        # we double check that they are aliases\n        if task.pca_projection is not None:\n            self.__ensure_task_same_for_pca(task)\n            assert task.pca_projection is self.pca_projection\n        if task.initialization is not None:\n            self.__ensure_task_same_for_initialization(task)\n            assert task.initialization is self.initialization\n        if task.affinities is not None:\n            assert task.affinities is self.affinities\n        if task.tsne_embedding is not None:\n            self.__ensure_task_same_for_embedding(task)\n            assert task.tsne_embedding is self.tsne_embedding\n\n        self.commit.deferred()\n\n    def _get_projection_data(self):\n        if self.data is None:\n            return None\n\n        data = self.data.transform(\n            Domain(\n                self.data.domain.attributes,\n                self.data.domain.class_vars,\n                self.data.domain.metas + self._get_projection_variables()\n            )\n        )\n        with data.unlocked(data.metas):\n            data.metas[:, -2:] = self.get_embedding()\n        if self.tsne_embedding is not None:\n            data.domain = Domain(\n                self.data.domain.attributes,\n                self.data.domain.class_vars,\n                self.data.domain.metas + self.tsne_embedding.domain.attributes,\n            )\n        return data\n\n    def clear(self):\n        \"\"\"Clear widget state. Note that this doesn't clear the data.\"\"\"\n        super().clear()\n        self.run_button.setText(\"Start\")\n        self.cancel()\n        self.normalized_data = None\n        self.pca_projection = None\n        self.initialization = None\n        self.affinities = None\n        self.tsne_embedding = None\n        self.iterations_done = 0\n\n    def onDeleteWidget(self):\n        self.clear()\n        self.data = None\n        self.shutdown()\n        super().onDeleteWidget()\n\n    @classmethod\n    def migrate_settings(cls, settings, version):\n        if version < 3:\n            if \"selection_indices\" in settings:\n                settings[\"selection\"] = settings[\"selection_indices\"]\n        if version < 4:\n            settings.pop(\"max_iter\", None)\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 3:\n            values = context.values\n            values[\"attr_color\"] = values[\"graph\"][\"attr_color\"]\n            values[\"attr_size\"] = values[\"graph\"][\"attr_size\"]\n            values[\"attr_shape\"] = values[\"graph\"][\"attr_shape\"]\n            values[\"attr_label\"] = values[\"graph\"][\"attr_label\"]",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 388,
                            "end_lineno": 396,
                            "parent": {
                                "file_name": "Orange/widgets/unsupervised/owtsne.py",
                                "type": "class",
                                "name": "OWtSNE",
                                "content": "class OWtSNE(OWDataProjectionWidget, ConcurrentWidgetMixin):\n    name = \"t-SNE\"\n    description = \"Two-dimensional data projection with t-SNE.\"\n    icon = \"icons/TSNE.svg\"\n    priority = 920\n    keywords = \"t-sne, tsne\"\n\n    settings_version = 4\n    perplexity = ContextSetting(30)\n    multiscale = ContextSetting(False)\n    exaggeration = ContextSetting(1)\n\n    normalize = ContextSetting(True)\n    use_pca_preprocessing = ContextSetting(True)\n    pca_components = ContextSetting(_DEFAULT_PCA_COMPONENTS)\n\n    GRAPH_CLASS = OWtSNEGraph\n    graph = SettingProvider(OWtSNEGraph)\n    embedding_variables_names = (\"t-SNE-x\", \"t-SNE-y\")\n\n    # Use `invalidated` descriptor, so we don't break the usage of\n    # `_invalidated` in `OWDataProjectionWidget`, but still allow finer control\n    # over which parts of the embedding to invalidate\n    _invalidated = invalidated()\n\n    class Information(OWDataProjectionWidget.Information):\n        modified = Msg(\"The parameter settings have been changed. Press \"\n                       \"\\\"Start\\\" to rerun with the new settings.\")\n\n    class Warning(OWDataProjectionWidget.Warning):\n        consider_using_pca_preprocessing = Msg(\n            \"The input data contains a large number of features, which may slow\"\n            \" down t-SNE computation. Consider enabling PCA preprocessing.\"\n        )\n\n    class Error(OWDataProjectionWidget.Error):\n        not_enough_rows = Msg(\"Input data needs at least 2 rows\")\n        not_enough_cols = Msg(\"Input data needs at least 2 attributes\")\n        constant_data = Msg(\"Input data is constant\")\n        no_valid_data = Msg(\"No projection due to no valid data\")\n\n    def __init__(self):\n        OWDataProjectionWidget.__init__(self)\n        ConcurrentWidgetMixin.__init__(self)\n        # Intermediate results\n        self.normalized_data = None       # type: Optional[Table]\n        self.pca_projection = None        # type: Optional[Table]\n        self.initialization = None        # type: Optional[np.ndarray]\n        self.affinities = None            # type: Optional[openTSNE.affinity.Affinities]\n        self.tsne_embedding = None        # type: Optional[manifold.TSNEModel]\n        self.iterations_done = 0          # type: int\n\n    @property\n    def effective_data(self):\n        return self.data.transform(Domain(self.effective_variables))\n\n    def _add_controls(self):\n        self._add_controls_start_box()\n        super()._add_controls()\n\n    def _add_controls_start_box(self):\n        preprocessing_box = gui.vBox(self.controlArea, box=\"Preprocessing\")\n        self.normalize_cbx = gui.checkBox(\n            preprocessing_box, self, \"normalize\", \"Normalize data\",\n            callback=self._invalidate_normalized_data,\n        )\n        self.pca_preprocessing_cbx = gui.checkBox(\n            preprocessing_box, self, \"use_pca_preprocessing\", \"Preprocess using PCA\",\n            callback=self._pca_preprocessing_changed,\n        )\n        self.pca_component_slider = gui.hSlider(\n            preprocessing_box, self, \"pca_components\", label=\"PCA Components:\",\n            minValue=2, maxValue=_MAX_PCA_COMPONENTS, step=1,\n            callback=self._invalidate_pca_projection,\n        )\n\n        box = gui.vBox(self.controlArea, box=\"Parameters\")\n        form = QFormLayout(\n            labelAlignment=Qt.AlignLeft,\n            formAlignment=Qt.AlignLeft,\n            fieldGrowthPolicy=QFormLayout.AllNonFixedFieldsGrow,\n        )\n\n        self.perplexity_spin = gui.spin(\n            box, self, \"perplexity\", 1, 500, step=1, alignment=Qt.AlignRight,\n            callback=self._invalidate_affinities, addToLayout=False\n        )\n        self.controls.perplexity.setDisabled(self.multiscale)\n        form.addRow(\"Perplexity:\", self.perplexity_spin)\n        form.addRow(gui.checkBox(\n            box, self, \"multiscale\", label=\"Preserve global structure\",\n            callback=self._multiscale_changed, addToLayout=False\n        ))\n\n        sbe = gui.hBox(self.controlArea, False, addToLayout=False)\n        gui.hSlider(\n            sbe, self, \"exaggeration\", minValue=1, maxValue=4, step=1,\n            callback=self._invalidate_tsne_embedding,\n        )\n        form.addRow(\"Exaggeration:\", sbe)\n\n        box.layout().addLayout(form)\n\n        self.run_button = gui.button(box, self, \"Start\", callback=self._toggle_run)\n\n    # Control callbacks\n    def _normalize_data_changed(self):\n        self._invalidate_normalized_data()\n\n    def _pca_preprocessing_changed(self):\n        self.controls.pca_components.setEnabled(self.use_pca_preprocessing)\n        self._invalidate_pca_projection()\n\n        should_warn_pca = False\n        if self.data is not None and not self.use_pca_preprocessing:\n            if len(self.data.domain.attributes) >= _MAX_PCA_COMPONENTS:\n                should_warn_pca = True\n        self.Warning.consider_using_pca_preprocessing(shown=should_warn_pca)\n\n    def _multiscale_changed(self):\n        self.controls.perplexity.setDisabled(self.multiscale)\n        self._invalidate_affinities()\n\n    # Invalidateion cascade\n    def _invalidate_normalized_data(self):\n        self._invalidated.normalized_data = True\n        self._invalidate_pca_projection()\n\n    def _invalidate_pca_projection(self):\n        self._invalidated.pca_projection = True\n        self._invalidate_affinities()\n\n    def _invalidate_affinities(self):\n        self._invalidated.affinities = True\n        self._invalidate_tsne_embedding()\n\n    def _invalidate_tsne_embedding(self):\n        self._invalidated.tsne_embedding = True\n        self._stop_running_task()\n        self._set_modified(True)\n\n    def _stop_running_task(self):\n        self.cancel()\n        self.run_button.setText(\"Start\")\n\n    def _set_modified(self, state):\n        \"\"\"Mark the widget (GUI) as containing modified state.\"\"\"\n        if self.data is None:\n            # Does not apply when we have no data\n            state = False\n        self.Information.modified(shown=state)\n\n    def check_data(self):\n        def error(err):\n            err()\n            self.data = None\n\n        # `super().check_data()` clears all messages, so we have to remember if\n        # it was shown\n        # pylint: disable=assignment-from-no-return\n        should_show_modified_message = self.Information.modified.is_shown()\n        super().check_data()\n\n        if self.data is None:\n            return\n\n        self.Information.modified(shown=should_show_modified_message)\n\n        if len(self.data) < 2:\n            error(self.Error.not_enough_rows)\n\n        elif len(self.data.domain.attributes) < 2:\n            error(self.Error.not_enough_cols)\n\n        elif not self.data.is_sparse():\n            if np.all(~np.isfinite(self.data.X)):\n                error(self.Error.no_valid_data)\n            else:\n                with warnings.catch_warnings():\n                    warnings.filterwarnings(\n                        \"ignore\", \"Degrees of freedom .*\", RuntimeWarning)\n                    if np.nan_to_num(np.nanstd(self.data.X, axis=0)).sum() \\\n                            == 0:\n                        error(self.Error.constant_data)\n\n    def get_embedding(self):\n        if self.tsne_embedding is None:\n            self.valid_data = None\n            return None\n\n        embedding = self.tsne_embedding.embedding.X\n        self.valid_data = np.ones(len(embedding), dtype=bool)\n        return embedding\n\n    def _toggle_run(self):\n        # If no data, there's nothing to do\n        if self.data is None:\n            return\n\n        # Pause task\n        if self.task is not None:\n            self.cancel()\n            self.run_button.setText(\"Resume\")\n            self.commit.deferred()\n        # Resume task\n        else:\n            self.run()\n\n    def handleNewSignals(self):\n        # We don't bother with the granular invalidation flags because\n        # `super().handleNewSignals` will just set all of them to False or will\n        # do nothing. However, it's important we remember its state because we\n        # won't call `run` if needed. `run` also relies on the state of\n        # `_invalidated` to properly set the intermediate values to None\n        prev_invalidated = bool(self._invalidated)\n        super().handleNewSignals()\n        self._invalidated = prev_invalidated\n\n        if self._invalidated:\n            self.run()\n\n    def init_attr_values(self):\n        super().init_attr_values()\n\n        if self.data is not None:\n            n_attrs = len(self.data.domain.attributes)\n            max_components = min(_MAX_PCA_COMPONENTS, n_attrs)\n        else:\n            max_components = _MAX_PCA_COMPONENTS\n\n        # We set this to the default number of components here so it resets\n        # properly, any previous settings will be restored from context\n        # settings a little later\n        self.controls.pca_components.setMaximum(max_components)\n        self.controls.pca_components.setValue(_DEFAULT_PCA_COMPONENTS)\n\n        self.exaggeration = 1\n\n    def enable_controls(self):\n        super().enable_controls()\n\n        if self.data is not None:\n            # PCA doesn't support normalization on sparse data, as this would\n            # require centering and normalizing the matrix\n            self.normalize_cbx.setDisabled(self.data.is_sparse())\n            if self.data.is_sparse():\n                self.normalize = False\n                self.normalize_cbx.setToolTip(\n                    \"Data normalization is not supported on sparse matrices.\"\n                )\n            else:\n                self.normalize_cbx.setToolTip(\"\")\n\n        # Disable the perplexity spin box if multiscale is turned on\n        self.controls.perplexity.setDisabled(self.multiscale)\n\n    def run(self):\n        # Reset invalidated values as indicated by the flags\n        if self._invalidated.pca_projection:\n            self.pca_projection = None\n        if self._invalidated.affinities:\n            self.affinities = None\n        if self._invalidated.tsne_embedding:\n            self.iterations_done = 0\n            self.tsne_embedding = None\n\n        self._set_modified(False)\n        self._invalidated = False\n\n        # When the data is invalid, it is set to `None` and an error is set,\n        # therefore it would be erroneous to clear the error here\n        if self.data is not None:\n            self.run_button.setText(\"Stop\")\n\n        # Cancel current running task\n        self.cancel()\n\n        if self.data is None:\n            return\n\n        task = Task(\n            data=self.data,\n            # Normalization\n            normalize=self.normalize,\n            normalized_data=self.normalized_data,\n            # PCA preprocessing\n            use_pca_preprocessing=self.use_pca_preprocessing,\n            pca_components=self.pca_components,\n            pca_projection=self.pca_projection,\n            # t-SNE parameters\n            perplexity=self.perplexity,\n            multiscale=self.multiscale,\n            exaggeration=self.exaggeration,\n            initialization=self.initialization,\n            affinities=self.affinities,\n            # Misc\n            tsne_embedding=self.tsne_embedding,\n            iterations_done=self.iterations_done,\n        )\n        return self.start(TSNERunner.run, task)\n\n    def __ensure_task_same_for_normalization(self, task: Task):\n        assert self.data is not None\n        assert task.normalize == self.normalize\n        if task.normalize:\n            assert isinstance(task.normalized_data, Table) and \\\n                len(task.normalized_data) == len(self.data)\n\n    def __ensure_task_same_for_pca(self, task: Task):\n        assert self.data is not None\n        assert task.use_pca_preprocessing == self.use_pca_preprocessing\n        if task.use_pca_preprocessing:\n            assert task.pca_components == self.pca_components\n            assert isinstance(task.pca_projection, Table) and \\\n                len(task.pca_projection) == len(self.data)\n\n    def __ensure_task_same_for_initialization(self, task: Task):\n        assert isinstance(task.initialization, np.ndarray) and \\\n            len(task.initialization) == len(self.data)\n\n    def __ensure_task_same_for_affinities(self, task: Task):\n        assert task.perplexity == self.perplexity\n        assert task.multiscale == self.multiscale\n\n    def __ensure_task_same_for_embedding(self, task: Task):\n        assert task.exaggeration == self.exaggeration\n        assert isinstance(task.tsne_embedding, manifold.TSNEModel) and \\\n            len(task.tsne_embedding.embedding) == len(self.data)\n\n    def on_partial_result(self, value):\n        # type: (Tuple[str, Task]) -> None\n        which, task = value\n\n        if which == \"normalized_data\":\n            self.__ensure_task_same_for_normalization(task)\n            self.normalized_data = task.normalized_data\n        elif which == \"pca_projection\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.pca_projection = task.pca_projection\n        elif which == \"initialization\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_initialization(task)\n            self.initialization = task.initialization\n        elif which == \"affinities\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_affinities(task)\n            self.affinities = task.affinities\n        elif which == \"tsne_embedding\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_initialization(task)\n            self.__ensure_task_same_for_affinities(task)\n            self.__ensure_task_same_for_embedding(task)\n\n            prev_embedding, self.tsne_embedding = self.tsne_embedding, task.tsne_embedding\n            self.iterations_done = task.iterations_done\n            # If this is the first partial result we've gotten, we've got to\n            # setup the plot\n            if prev_embedding is None:\n                self.setup_plot()\n            # Otherwise, just update the point positions\n            else:\n                self.graph.update_coordinates()\n                self.graph.update_density()\n        else:\n            raise RuntimeError(\n                \"Unrecognized partial result called with `%s`\" % which\n            )\n\n    def on_done(self, task):\n        # type: (Task) -> None\n        self.run_button.setText(\"Start\")\n        # NOTE: All of these have already been set by on_partial_result,\n        # we double check that they are aliases\n        if task.pca_projection is not None:\n            self.__ensure_task_same_for_pca(task)\n            assert task.pca_projection is self.pca_projection\n        if task.initialization is not None:\n            self.__ensure_task_same_for_initialization(task)\n            assert task.initialization is self.initialization\n        if task.affinities is not None:\n            assert task.affinities is self.affinities\n        if task.tsne_embedding is not None:\n            self.__ensure_task_same_for_embedding(task)\n            assert task.tsne_embedding is self.tsne_embedding\n\n        self.commit.deferred()\n\n    def _get_projection_data(self):\n        if self.data is None:\n            return None\n\n        data = self.data.transform(\n            Domain(\n                self.data.domain.attributes,\n                self.data.domain.class_vars,\n                self.data.domain.metas + self._get_projection_variables()\n            )\n        )\n        with data.unlocked(data.metas):\n            data.metas[:, -2:] = self.get_embedding()\n        if self.tsne_embedding is not None:\n            data.domain = Domain(\n                self.data.domain.attributes,\n                self.data.domain.class_vars,\n                self.data.domain.metas + self.tsne_embedding.domain.attributes,\n            )\n        return data\n\n    def clear(self):\n        \"\"\"Clear widget state. Note that this doesn't clear the data.\"\"\"\n        super().clear()\n        self.run_button.setText(\"Start\")\n        self.cancel()\n        self.normalized_data = None\n        self.pca_projection = None\n        self.initialization = None\n        self.affinities = None\n        self.tsne_embedding = None\n        self.iterations_done = 0\n\n    def onDeleteWidget(self):\n        self.clear()\n        self.data = None\n        self.shutdown()\n        super().onDeleteWidget()\n\n    @classmethod\n    def migrate_settings(cls, settings, version):\n        if version < 3:\n            if \"selection_indices\" in settings:\n                settings[\"selection\"] = settings[\"selection_indices\"]\n        if version < 4:\n            settings.pop(\"max_iter\", None)\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 3:\n            values = context.values\n            values[\"attr_color\"] = values[\"graph\"][\"attr_color\"]\n            values[\"attr_size\"] = values[\"graph\"][\"attr_size\"]\n            values[\"attr_shape\"] = values[\"graph\"][\"attr_shape\"]\n            values[\"attr_label\"] = values[\"graph\"][\"attr_label\"]",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 279,
                                "end_lineno": 724,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "import unittest\nfrom unittest.mock import patch, Mock, call\n\nimport numpy as np\n\nfrom Orange.data import DiscreteVariable, ContinuousVariable, Domain, Table\nfrom Orange.preprocess import Normalize\nfrom Orange.projection import manifold, TSNE\nfrom Orange.projection.manifold import TSNEModel\nfrom Orange.widgets.tests.base import (\n    WidgetTest, WidgetOutputsTestMixin, ProjectionWidgetTestMixin\n)\nfrom Orange.widgets.unsupervised.owtsne import OWtSNE, TSNERunner, Task, prepare_tsne_obj\n\n\nclass DummyTSNE(manifold.TSNE):\n    def fit(self, X, Y=None):\n        return np.ones((len(X), 2), float)\n\n\nclass DummyTSNEModel(manifold.TSNEModel):\n    def transform(self, X, **kwargs):\n        return np.ones((len(X), 2), float)\n\n    def optimize(self, n_iter, **kwargs):\n        return self\n\n\nclass TestOWtSNE(WidgetTest, ProjectionWidgetTestMixin, WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n        cls.same_input_output_domain = False\n\n        cls.signal_name = OWtSNE.Inputs.data\n        cls.signal_data = cls.data\n\n    def setUp(self):\n        # For almost all the tests, we won't need to verify t-SNE validity and\n        # the tests will run much faster if we dummy them out\n        self.tsne = patch(\"Orange.projection.manifold.TSNE\", new=DummyTSNE)\n        self.tsne_model = patch(\"Orange.projection.manifold.TSNEModel\", new=DummyTSNEModel)\n        self.tsne.start()\n        self.tsne_model.start()\n\n        self.widget = self.create_widget(OWtSNE, stored_settings={\"multiscale\": False})\n\n        self.class_var = DiscreteVariable(\"Stage name\", values=(\"STG1\", \"STG2\"))\n        self.attributes = [ContinuousVariable(\"GeneName\" + str(i)) for i in range(5)]\n        self.domain = Domain(self.attributes, class_vars=self.class_var)\n        self.empty_domain = Domain([], class_vars=self.class_var)\n\n    def tearDown(self):\n        # Some tests may not wait for the widget to finish, and the patched\n        # methods might be unpatched before the widget finishes, resulting in\n        # a very confusing crash.\n        self.widget.onDeleteWidget()\n        try:\n            self.restore_mocked_functions()\n        # If `restore_mocked_functions` was called in the test itself, stopping\n        # the patchers here will raise a RuntimeError\n        except RuntimeError as e:\n            if str(e) != \"stop called on unstarted patcher\":\n                raise e\n\n    def restore_mocked_functions(self):\n        self.tsne.stop()\n        self.tsne_model.stop()\n\n    def test_wrong_input(self):\n        # no data\n        data = None\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n\n        # <2 rows\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_rows.is_shown())\n\n        # no attributes\n        data = Table.from_list(self.empty_domain, [['STG1']] * 2)\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_cols.is_shown())\n\n        # one attributes\n        data = Table.from_list(self.empty_domain, [[1, 'STG1'],\n                                                   [2, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_cols.is_shown())\n\n        # constant data\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1']] * 2)\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.constant_data.is_shown())\n\n        # correct input\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1'],\n                                             [5, 4, 3, 2, 1, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNotNone(self.widget.data)\n        self.assertFalse(self.widget.Error.not_enough_rows.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_cols.is_shown())\n        self.assertFalse(self.widget.Error.constant_data.is_shown())\n\n    def test_input(self):\n        data = Table.from_list(self.domain, [[1, 1, 1, 1, 1, 'STG1'],\n                                             [2, 2, 2, 2, 2, 'STG1'],\n                                             [4, 4, 4, 4, 4, 'STG2'],\n                                             [5, 5, 5, 5, 5, 'STG2']])\n\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n\n    def test_attr_models(self):\n        \"\"\"Check possible values for 'Color', 'Shape', 'Size' and 'Label'\"\"\"\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        controls = self.widget.controls\n        for var in self.data.domain.class_vars + self.data.domain.metas:\n            self.assertIn(var, controls.attr_color.model())\n            self.assertIn(var, controls.attr_label.model())\n            if var.is_continuous:\n                self.assertIn(var, controls.attr_size.model())\n                self.assertNotIn(var, controls.attr_shape.model())\n            if var.is_discrete:\n                self.assertNotIn(var, controls.attr_size.model())\n                self.assertIn(var, controls.attr_shape.model())\n\n    def test_multiscale_changed_updates_ui(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertFalse(self.widget.controls.multiscale.isChecked())\n        self.assertTrue(self.widget.perplexity_spin.isEnabled())\n        self.widget.controls.multiscale.setChecked(True)\n        self.assertFalse(self.widget.perplexity_spin.isEnabled())\n\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWtSNE, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        self.assertTrue(w.controls.multiscale.isChecked())\n        self.assertFalse(w.perplexity_spin.isEnabled())\n        w.onDeleteWidget()\n\n    def test_normalize_data(self):\n        # Normalization should be checked by default\n        self.assertTrue(self.widget.controls.normalize.isChecked())\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_called_once()\n\n        # Disable checkbox\n        self.widget.controls.normalize.setChecked(False)\n        self.assertFalse(self.widget.controls.normalize.isChecked())\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_not_called()\n\n        # Normalization shouldn't work on sparse data\n        self.widget.controls.normalize.setChecked(True)\n        self.assertTrue(self.widget.controls.normalize.isChecked())\n\n        sparse_data = self.data.to_sparse()\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, sparse_data)\n            self.assertFalse(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_not_called()\n\n    @patch(\"Orange.projection.manifold.TSNEModel.optimize\")\n    def test_exaggeration_is_passed_through_properly(self, optimize):\n        def _check_exaggeration(call, exaggeration):\n            # Check the last call to `optimize`, so we catch one during the\n            # regular regime\n            _, _, kwargs = call.mock_calls[-1]\n            self.assertIn(\"exaggeration\", kwargs)\n            self.assertEqual(kwargs[\"exaggeration\"], exaggeration)\n\n        # Since optimize needs to return a valid TSNEModel instance and it is\n        # impossible to return `self` in a mock, we'll prepare this one ahead\n        # of time and use this\n        optimize.return_value = DummyTSNE()(self.data)\n\n        # Set value to 1\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.run_button.clicked.emit()  # stop initial run\n        self.wait_until_stop_blocking()\n        self.widget.controls.exaggeration.setValue(1)\n        self.widget.run_button.clicked.emit()  # run with exaggeration 1\n        self.wait_until_finished()\n        _check_exaggeration(optimize, 1)\n\n        # Reset and clear state\n        self.send_signal(self.widget.Inputs.data, None)\n        optimize.reset_mock()\n\n        # Change to 3\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.run_button.clicked.emit()  # stop initial run\n        self.wait_until_stop_blocking()\n        self.widget.controls.exaggeration.setValue(3)\n        self.widget.run_button.clicked.emit()  # run with exaggeration 1\n        self.wait_until_finished()\n        _check_exaggeration(optimize, 3)\n\n    def test_plot_once(self):\n        \"\"\"Test if data is plotted only once but committed on every input change\"\"\"\n        self.widget.setup_plot = Mock()\n        self.widget.commit.deferred = self.widget.commit.now = Mock()\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        # TODO: The base widget immediately calls `setup_plot` and `commit`\n        # even though there's nothing to show yet. Unfortunately, fixing this\n        # would require changing `OWDataProjectionWidget` in some strange way,\n        # so as a temporary fix, we reset the mocks, so they reflect the calls\n        # when the result was available.\n        self.widget.setup_plot.reset_mock()\n        self.widget.commit.deferred.reset_mock()\n        self.wait_until_finished()\n\n        self.widget.setup_plot.assert_called_once()\n        self.widget.commit.deferred.assert_called_once()\n\n        self.widget.commit.deferred.reset_mock()\n        self.send_signal(self.widget.Inputs.data_subset, self.data[::10])\n        self.wait_until_stop_blocking()\n\n        self.widget.setup_plot.assert_called_once()\n        self.widget.commit.deferred.assert_called_once()\n\n    def test_modified_info_message_behaviour(self):\n        \"\"\"Information messages should be cleared if the data changes or if\n        the data is set to None.\"\"\"\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden by default\"\n        )\n\n        self.widget.controls.multiscale.setChecked(False)\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden even after toggling \"\n            \"options if no data is on input\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden after the widget \"\n            \"computes the embedding\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden when reloading the \"\n            \"same data set and no previous messages were shown\"\n        )\n\n        self.widget.controls.multiscale.setChecked(True)\n        self.assertTrue(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be shown when a setting is \"\n            \"changed, but the embedding is not recomputed\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, Table(\"housing\"))\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The information message was not cleared on new data\"\n        )\n        # Flip; the info message should now be shown again.\n        self.widget.controls.multiscale.setChecked(False)\n        assert self.widget.Information.modified.is_shown()  # sanity check\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The information message was not cleared on no data\"\n        )\n\n    def test_invalidation_flow(self):\n        # pylint: disable=protected-access\n        w = self.widget\n        # Setup widget: send data to input with global structure \"off\", then\n        # set global structure \"on\" (after the embedding is computed)\n        w.controls.multiscale.setChecked(False)\n        self.send_signal(w.Inputs.data, self.data)\n        self.wait_until_finished()\n        self.assertFalse(self.widget.Information.modified.is_shown())\n        # All the embedding components should be computed\n        self.assertIsNotNone(w.normalized_data)\n        self.assertIsNotNone(w.pca_projection)\n        self.assertIsNotNone(w.affinities)\n        self.assertIsNotNone(w.tsne_embedding)\n        # All the invalidation flags should be set to false\n        self.assertFalse(w._invalidated.normalized_data)\n        self.assertFalse(w._invalidated.pca_projection)\n        self.assertFalse(w._invalidated.affinities)\n        self.assertFalse(w._invalidated.tsne_embedding)\n\n        # Trigger invalidation\n        w.controls.multiscale.setChecked(True)\n        self.assertTrue(self.widget.Information.modified.is_shown())\n        # Setting `multiscale` to true should set the invalidate flags for\n        # the affinities and embedding, but not the pca_projection\n        self.assertFalse(w._invalidated.normalized_data)\n        self.assertFalse(w._invalidated.pca_projection)\n        self.assertTrue(w._invalidated.affinities)\n        self.assertTrue(w._invalidated.tsne_embedding)\n\n        # The flags should now be set, but the embedding should still be\n        # available when selecting a subset of data and such\n        self.assertIsNotNone(w.normalized_data)\n        self.assertIsNotNone(w.pca_projection)\n        self.assertIsNotNone(w.affinities)\n        self.assertIsNotNone(w.tsne_embedding)\n\n        # We should still be able to send a data subset to the input and have\n        # the points be highlighted\n        self.send_signal(w.Inputs.data_subset, self.data[:10])\n        self.wait_until_stop_blocking()\n        subset = [brush.color().name() == \"#46befa\" for brush in\n                  w.graph.scatterplot_item.data[\"brush\"][:10]]\n        other = [brush.color().name() == \"#000000\" for brush in\n                 w.graph.scatterplot_item.data[\"brush\"][10:]]\n        self.assertTrue(all(subset))\n        self.assertTrue(all(other))\n\n        # Clear the data subset\n        self.send_signal(w.Inputs.data_subset, None)\n\n        # Run the optimization\n        self.widget.run_button.clicked.emit()\n        self.wait_until_stop_blocking()\n        # All of the inavalidation flags should have been cleared\n        self.assertFalse(w._invalidated)\n\n\nclass TestTSNERunner(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.data = Table(\"iris\")\n\n    def test_run_with_normalization_and_pca_preprocessing(self):\n        state = Mock()\n        state.is_interruption_requested = Mock(return_value=False)\n\n        task = Task(\n            normalize=True, use_pca_preprocessing=True, data=self.data, perplexity=30\n        )\n        task = TSNERunner.run(task, state)\n\n        self.assertEqual(len(state.set_status.mock_calls), 5)\n        state.set_status.assert_has_calls([\n            call(\"Normalizing data...\"),\n            call(\"Computing PCA...\"),\n            call(\"Preparing initialization...\"),\n            call(\"Finding nearest neighbors...\"),\n            call(\"Running optimization...\"),\n        ])\n\n        self.assertIsInstance(task.normalized_data, Table)\n        self.assertIsInstance(task.pca_projection, Table)\n        self.assertIsInstance(task.tsne, TSNE)\n        self.assertIsInstance(task.tsne_embedding, TSNEModel)\n\n    def test_run_with_normalization(self):\n        state = Mock()\n        state.is_interruption_requested = Mock(return_value=False)\n\n        task = Task(\n            normalize=True, use_pca_preprocessing=False, data=self.data, perplexity=30\n        )\n        task = TSNERunner.run(task, state)\n\n        self.assertEqual(len(state.set_status.mock_calls), 4)\n        state.set_status.assert_has_calls([\n            call(\"Normalizing data...\"),\n            call(\"Preparing initialization...\"),\n            call(\"Finding nearest neighbors...\"),\n            call(\"Running optimization...\"),\n        ])\n\n        self.assertIsNone(task.pca_projection, Table)\n\n        self.assertIsInstance(task.normalized_data, Table)\n        self.assertIsInstance(task.tsne, TSNE)\n        self.assertIsInstance(task.tsne_embedding, TSNEModel)\n\n    def test_run_with_pca_preprocessing(self):\n        state = Mock()\n        state.is_interruption_requested = Mock(return_value=False)\n\n        task = Task(\n            normalize=False, use_pca_preprocessing=True, data=self.data, perplexity=30\n        )\n        task = TSNERunner.run(task, state)\n\n        self.assertEqual(len(state.set_status.mock_calls), 4)\n        state.set_status.assert_has_calls([\n            call(\"Computing PCA...\"),\n            call(\"Preparing initialization...\"),\n            call(\"Finding nearest neighbors...\"),\n            call(\"Running optimization...\"),\n        ])\n        state.set_status.assert_has_calls\n\n        self.assertIsNone(task.normalized_data, Table)\n\n        self.assertIsInstance(task.pca_projection, Table)\n        self.assertIsInstance(task.tsne, TSNE)\n        self.assertIsInstance(task.tsne_embedding, TSNEModel)\n\n    def test_run_do_not_modify_model_inplace(self):\n        state = Mock()\n        state.is_interruption_requested.return_value = True\n\n        task = Task(data=self.data, perplexity=30, multiscale=False, exaggeration=1)\n        # Run through all the steps to prepare the t-SNE object\n        task.tsne = prepare_tsne_obj(\n            task.data, task.perplexity, task.multiscale, task.exaggeration\n        )\n        TSNERunner.compute_normalization(task, state)\n        TSNERunner.compute_pca(task, state)\n        TSNERunner.compute_initialization(task, state)\n        TSNERunner.compute_affinities(task, state)\n        # Run the t-SNE iteration once to create the object\n        TSNERunner.compute_tsne(task, state)\n\n        # Make sure that running t-SNE for another iteration returns a new object\n        tsne_obj_before = task.tsne_embedding\n        state.reset_mock()\n        TSNERunner.compute_tsne(task, state)\n        tsne_obj_after = task.tsne_embedding\n\n        state.set_partial_result.assert_called_once()\n        self.assertIsNot(tsne_obj_before, tsne_obj_after)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "new_file_content": "import unittest\nfrom unittest.mock import patch, Mock, call\n\nimport numpy as np\n\nfrom Orange.data import DiscreteVariable, ContinuousVariable, Domain, Table\nfrom Orange.preprocess import Normalize\nfrom Orange.projection import manifold, TSNE\nfrom Orange.projection.manifold import TSNEModel\nfrom Orange.widgets.tests.base import (\n    WidgetTest, WidgetOutputsTestMixin, ProjectionWidgetTestMixin\n)\nfrom Orange.widgets.unsupervised.owtsne import OWtSNE, TSNERunner, Task, prepare_tsne_obj\n\n\nclass DummyTSNE(manifold.TSNE):\n    def fit(self, X, Y=None):\n        return np.ones((len(X), 2), float)\n\n\nclass DummyTSNEModel(manifold.TSNEModel):\n    def transform(self, X, **kwargs):\n        return np.ones((len(X), 2), float)\n\n    def optimize(self, n_iter, **kwargs):\n        return self\n\n\nclass TestOWtSNE(WidgetTest, ProjectionWidgetTestMixin, WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n        cls.same_input_output_domain = False\n\n        cls.signal_name = OWtSNE.Inputs.data\n        cls.signal_data = cls.data\n\n    def setUp(self):\n        # For almost all the tests, we won't need to verify t-SNE validity and\n        # the tests will run much faster if we dummy them out\n        self.tsne = patch(\"Orange.projection.manifold.TSNE\", new=DummyTSNE)\n        self.tsne_model = patch(\"Orange.projection.manifold.TSNEModel\", new=DummyTSNEModel)\n        self.tsne.start()\n        self.tsne_model.start()\n\n        self.widget = self.create_widget(OWtSNE, stored_settings={\"multiscale\": False})\n\n        self.class_var = DiscreteVariable(\"Stage name\", values=(\"STG1\", \"STG2\"))\n        self.attributes = [ContinuousVariable(\"GeneName\" + str(i)) for i in range(5)]\n        self.domain = Domain(self.attributes, class_vars=self.class_var)\n        self.empty_domain = Domain([], class_vars=self.class_var)\n\n    def tearDown(self):\n        # Some tests may not wait for the widget to finish, and the patched\n        # methods might be unpatched before the widget finishes, resulting in\n        # a very confusing crash.\n        self.widget.onDeleteWidget()\n        try:\n            self.restore_mocked_functions()\n        # If `restore_mocked_functions` was called in the test itself, stopping\n        # the patchers here will raise a RuntimeError\n        except RuntimeError as e:\n            if str(e) != \"stop called on unstarted patcher\":\n                raise e\n\n    def restore_mocked_functions(self):\n        self.tsne.stop()\n        self.tsne_model.stop()\n\n    def test_wrong_input(self):\n        # no data\n        data = None\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n\n        # <2 rows\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_rows.is_shown())\n\n        # no attributes\n        data = Table.from_list(self.empty_domain, [['STG1']] * 2)\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_cols.is_shown())\n\n        # one attributes\n        data = Table.from_list(self.empty_domain, [[1, 'STG1'],\n                                                   [2, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_cols.is_shown())\n\n        # constant data\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1']] * 2)\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.constant_data.is_shown())\n\n        # correct input\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1'],\n                                             [5, 4, 3, 2, 1, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNotNone(self.widget.data)\n        self.assertFalse(self.widget.Error.not_enough_rows.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_cols.is_shown())\n        self.assertFalse(self.widget.Error.constant_data.is_shown())\n\n    def test_input(self):\n        data = Table.from_list(self.domain, [[1, 1, 1, 1, 1, 'STG1'],\n                                             [2, 2, 2, 2, 2, 'STG1'],\n                                             [4, 4, 4, 4, 4, 'STG2'],\n                                             [5, 5, 5, 5, 5, 'STG2']])\n\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n\n    def test_attr_models(self):\n        \"\"\"Check possible values for 'Color', 'Shape', 'Size' and 'Label'\"\"\"\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        controls = self.widget.controls\n        for var in self.data.domain.class_vars + self.data.domain.metas:\n            self.assertIn(var, controls.attr_color.model())\n            self.assertIn(var, controls.attr_label.model())\n            if var.is_continuous:\n                self.assertIn(var, controls.attr_size.model())\n                self.assertNotIn(var, controls.attr_shape.model())\n            if var.is_discrete:\n                self.assertNotIn(var, controls.attr_size.model())\n                self.assertIn(var, controls.attr_shape.model())\n\n    def test_multiscale_changed_updates_ui(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertFalse(self.widget.controls.multiscale.isChecked())\n        self.assertTrue(self.widget.perplexity_spin.isEnabled())\n        self.widget.controls.multiscale.setChecked(True)\n        self.assertFalse(self.widget.perplexity_spin.isEnabled())\n\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWtSNE, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        self.assertTrue(w.controls.multiscale.isChecked())\n        self.assertFalse(w.perplexity_spin.isEnabled())\n        w.onDeleteWidget()\n\n    def test_normalize_data(self):\n        # Normalization should be checked by default\n        self.assertTrue(self.widget.controls.normalize.isChecked())\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_called_once()\n\n        # Disable checkbox\n        self.widget.controls.normalize.setChecked(False)\n        self.assertFalse(self.widget.controls.normalize.isChecked())\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_not_called()\n\n        # Normalization shouldn't work on sparse data\n        self.widget.controls.normalize.setChecked(True)\n        self.assertTrue(self.widget.controls.normalize.isChecked())\n\n        sparse_data = self.data.to_sparse()\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, sparse_data)\n            self.assertFalse(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_not_called()\n\n    @patch(\"Orange.projection.manifold.TSNEModel.optimize\")\n    def test_exaggeration_is_passed_through_properly(self, optimize):\n        def _check_exaggeration(call, exaggeration):\n            # Check the last call to `optimize`, so we catch one during the\n            # regular regime\n            _, _, kwargs = call.mock_calls[-1]\n            self.assertIn(\"exaggeration\", kwargs)\n            self.assertEqual(kwargs[\"exaggeration\"], exaggeration)\n\n        # Since optimize needs to return a valid TSNEModel instance and it is\n        # impossible to return `self` in a mock, we'll prepare this one ahead\n        # of time and use this\n        optimize.return_value = DummyTSNE()(self.data)\n\n        # Set value to 1\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.run_button.clicked.emit()  # stop initial run\n        self.wait_until_stop_blocking()\n        self.widget.controls.exaggeration.setValue(1)\n        self.widget.run_button.clicked.emit()  # run with exaggeration 1\n        self.wait_until_finished()\n        _check_exaggeration(optimize, 1)\n\n        # Reset and clear state\n        self.send_signal(self.widget.Inputs.data, None)\n        optimize.reset_mock()\n\n        # Change to 3\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.run_button.clicked.emit()  # stop initial run\n        self.wait_until_stop_blocking()\n        self.widget.controls.exaggeration.setValue(3)\n        self.widget.run_button.clicked.emit()  # run with exaggeration 1\n        self.wait_until_finished()\n        _check_exaggeration(optimize, 3)\n\n    def test_plot_once(self):\n        \"\"\"Test if data is plotted only once but committed on every input change\"\"\"\n        self.widget.setup_plot = Mock()\n        self.widget.commit.deferred = self.widget.commit.now = Mock()\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        # TODO: The base widget immediately calls `setup_plot` and `commit`\n        # even though there's nothing to show yet. Unfortunately, fixing this\n        # would require changing `OWDataProjectionWidget` in some strange way,\n        # so as a temporary fix, we reset the mocks, so they reflect the calls\n        # when the result was available.\n        self.widget.setup_plot.reset_mock()\n        self.widget.commit.deferred.reset_mock()\n        self.wait_until_finished()\n\n        self.widget.setup_plot.assert_called_once()\n        self.widget.commit.deferred.assert_called_once()\n\n        self.widget.commit.deferred.reset_mock()\n        self.send_signal(self.widget.Inputs.data_subset, self.data[::10])\n        self.wait_until_stop_blocking()\n\n        self.widget.setup_plot.assert_called_once()\n        self.widget.commit.deferred.assert_called_once()\n\n    def test_modified_info_message_behaviour(self):\n        \"\"\"Information messages should be cleared if the data changes or if\n        the data is set to None.\"\"\"\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden by default\"\n        )\n\n        self.widget.controls.multiscale.setChecked(False)\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden even after toggling \"\n            \"options if no data is on input\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden after the widget \"\n            \"computes the embedding\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden when reloading the \"\n            \"same data set and no previous messages were shown\"\n        )\n\n        self.widget.controls.multiscale.setChecked(True)\n        self.assertTrue(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be shown when a setting is \"\n            \"changed, but the embedding is not recomputed\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, Table(\"housing\"))\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The information message was not cleared on new data\"\n        )\n        # Flip; the info message should now be shown again.\n        self.widget.controls.multiscale.setChecked(False)\n        assert self.widget.Information.modified.is_shown()  # sanity check\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The information message was not cleared on no data\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden after the widget \"\n            \"computes the embedding\"\n        )\n\n    def test_invalidation_flow(self):\n        # pylint: disable=protected-access\n        w = self.widget\n        # Setup widget: send data to input with global structure \"off\", then\n        # set global structure \"on\" (after the embedding is computed)\n        w.controls.multiscale.setChecked(False)\n        self.send_signal(w.Inputs.data, self.data)\n        self.wait_until_finished()\n        self.assertFalse(self.widget.Information.modified.is_shown())\n        # All the embedding components should be computed\n        self.assertIsNotNone(w.normalized_data)\n        self.assertIsNotNone(w.pca_projection)\n        self.assertIsNotNone(w.affinities)\n        self.assertIsNotNone(w.tsne_embedding)\n        # All the invalidation flags should be set to false\n        self.assertFalse(w._invalidated.normalized_data)\n        self.assertFalse(w._invalidated.pca_projection)\n        self.assertFalse(w._invalidated.affinities)\n        self.assertFalse(w._invalidated.tsne_embedding)\n\n        # Trigger invalidation\n        w.controls.multiscale.setChecked(True)\n        self.assertTrue(self.widget.Information.modified.is_shown())\n        # Setting `multiscale` to true should set the invalidate flags for\n        # the affinities and embedding, but not the pca_projection\n        self.assertFalse(w._invalidated.normalized_data)\n        self.assertFalse(w._invalidated.pca_projection)\n        self.assertTrue(w._invalidated.affinities)\n        self.assertTrue(w._invalidated.tsne_embedding)\n\n        # The flags should now be set, but the embedding should still be\n        # available when selecting a subset of data and such\n        self.assertIsNotNone(w.normalized_data)\n        self.assertIsNotNone(w.pca_projection)\n        self.assertIsNotNone(w.affinities)\n        self.assertIsNotNone(w.tsne_embedding)\n\n        # We should still be able to send a data subset to the input and have\n        # the points be highlighted\n        self.send_signal(w.Inputs.data_subset, self.data[:10])\n        self.wait_until_stop_blocking()\n        subset = [brush.color().name() == \"#46befa\" for brush in\n                  w.graph.scatterplot_item.data[\"brush\"][:10]]\n        other = [brush.color().name() == \"#000000\" for brush in\n                 w.graph.scatterplot_item.data[\"brush\"][10:]]\n        self.assertTrue(all(subset))\n        self.assertTrue(all(other))\n\n        # Clear the data subset\n        self.send_signal(w.Inputs.data_subset, None)\n\n        # Run the optimization\n        self.widget.run_button.clicked.emit()\n        self.wait_until_stop_blocking()\n        # All of the inavalidation flags should have been cleared\n        self.assertFalse(w._invalidated)\n\n    def test_pca_preprocessing_warning_with_large_number_of_features(self):\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden by default\"\n        )\n\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden even after toggling options if \"\n            \"no data is on input\"\n        )\n\n        # Setup data classes\n        x_small = np.random.normal(0, 1, size=(50, 4))\n        data_small = Table.from_numpy(Domain.from_numpy(x_small), x_small)\n        x_large = np.random.normal(0, 1, size=(50, 250))\n        data_large = Table.from_numpy(Domain.from_numpy(x_large), x_large)\n\n        # SMALL data with PCA preprocessing ENABLED\n        self.send_signal(self.widget.Inputs.data, data_small)\n        self.widget.controls.use_pca_preprocessing.setChecked(True)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden when PCA preprocessing enabled \"\n            \"when the data has <50 features\"\n        )\n\n        # SMALL data with PCA preprocessing DISABLED\n        self.send_signal(self.widget.Inputs.data, data_small)\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden with disabled PCA preprocessing \"\n            \"when the data has <50 features\"\n        )\n\n        # LARGE data with PCA preprocessing ENABLED\n        self.send_signal(self.widget.Inputs.data, data_large)\n        self.widget.controls.use_pca_preprocessing.setChecked(True)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden when PCA preprocessing enabled \"\n            \"when has >50 features\"\n        )\n\n        # LARGE data with PCA preprocessing DISABLED\n        self.send_signal(self.widget.Inputs.data, data_large)\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertTrue(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be shown when PCA preprocessing disabled \"\n            \"when the data has >50 features\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The PCA warning should be cleared when problematic data is removed\"\n        )\n\n\nclass TestTSNERunner(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.data = Table(\"iris\")\n\n    def test_run_with_normalization_and_pca_preprocessing(self):\n        state = Mock()\n        state.is_interruption_requested = Mock(return_value=False)\n\n        task = Task(\n            normalize=True, use_pca_preprocessing=True, data=self.data, perplexity=30\n        )\n        task = TSNERunner.run(task, state)\n\n        self.assertEqual(len(state.set_status.mock_calls), 5)\n        state.set_status.assert_has_calls([\n            call(\"Normalizing data...\"),\n            call(\"Computing PCA...\"),\n            call(\"Preparing initialization...\"),\n            call(\"Finding nearest neighbors...\"),\n            call(\"Running optimization...\"),\n        ])\n\n        self.assertIsInstance(task.normalized_data, Table)\n        self.assertIsInstance(task.pca_projection, Table)\n        self.assertIsInstance(task.tsne, TSNE)\n        self.assertIsInstance(task.tsne_embedding, TSNEModel)\n\n    def test_run_with_normalization(self):\n        state = Mock()\n        state.is_interruption_requested = Mock(return_value=False)\n\n        task = Task(\n            normalize=True, use_pca_preprocessing=False, data=self.data, perplexity=30\n        )\n        task = TSNERunner.run(task, state)\n\n        self.assertEqual(len(state.set_status.mock_calls), 4)\n        state.set_status.assert_has_calls([\n            call(\"Normalizing data...\"),\n            call(\"Preparing initialization...\"),\n            call(\"Finding nearest neighbors...\"),\n            call(\"Running optimization...\"),\n        ])\n\n        self.assertIsNone(task.pca_projection, Table)\n\n        self.assertIsInstance(task.normalized_data, Table)\n        self.assertIsInstance(task.tsne, TSNE)\n        self.assertIsInstance(task.tsne_embedding, TSNEModel)\n\n    def test_run_with_pca_preprocessing(self):\n        state = Mock()\n        state.is_interruption_requested = Mock(return_value=False)\n\n        task = Task(\n            normalize=False, use_pca_preprocessing=True, data=self.data, perplexity=30\n        )\n        task = TSNERunner.run(task, state)\n\n        self.assertEqual(len(state.set_status.mock_calls), 4)\n        state.set_status.assert_has_calls([\n            call(\"Computing PCA...\"),\n            call(\"Preparing initialization...\"),\n            call(\"Finding nearest neighbors...\"),\n            call(\"Running optimization...\"),\n        ])\n        state.set_status.assert_has_calls\n\n        self.assertIsNone(task.normalized_data, Table)\n\n        self.assertIsInstance(task.pca_projection, Table)\n        self.assertIsInstance(task.tsne, TSNE)\n        self.assertIsInstance(task.tsne_embedding, TSNEModel)\n\n    def test_run_do_not_modify_model_inplace(self):\n        state = Mock()\n        state.is_interruption_requested.return_value = True\n\n        task = Task(data=self.data, perplexity=30, multiscale=False, exaggeration=1)\n        # Run through all the steps to prepare the t-SNE object\n        task.tsne = prepare_tsne_obj(\n            task.data, task.perplexity, task.multiscale, task.exaggeration\n        )\n        TSNERunner.compute_normalization(task, state)\n        TSNERunner.compute_pca(task, state)\n        TSNERunner.compute_initialization(task, state)\n        TSNERunner.compute_affinities(task, state)\n        # Run the t-SNE iteration once to create the object\n        TSNERunner.compute_tsne(task, state)\n\n        # Make sure that running t-SNE for another iteration returns a new object\n        tsne_obj_before = task.tsne_embedding\n        state.reset_mock()\n        TSNERunner.compute_tsne(task, state)\n        tsne_obj_after = task.tsne_embedding\n\n        state.set_partial_result.assert_called_once()\n        self.assertIsNot(tsne_obj_before, tsne_obj_after)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n",
            "header": {
                "file": {
                    "path": "Orange/widgets/unsupervised/tests/test_owtsne.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "f99f29583",
                "new_commit_hash": "362c86dc4",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/Orange/widgets/unsupervised/tests/test_owtsne.py"
            },
            "plus_file": {
                "path": "b/Orange/widgets/unsupervised/tests/test_owtsne.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 297,
                            "length": 6
                        },
                        "new_range": {
                            "start": 297,
                            "length": 14
                        },
                        "section": "class TestOWtSNE(WidgetTest, ProjectionWidgetTestMixin, WidgetOutputsTestMixin):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "            \"The information message was not cleared on no data\"",
                                "type": "context"
                            },
                            {
                                "content": "        )",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.data, self.data)",
                                "type": "added"
                            },
                            {
                                "content": "        self.wait_until_stop_blocking()",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(",
                                "type": "added"
                            },
                            {
                                "content": "            self.widget.Information.modified.is_shown(),",
                                "type": "added"
                            },
                            {
                                "content": "            \"The modified info message should be hidden after the widget \"",
                                "type": "added"
                            },
                            {
                                "content": "            \"computes the embedding\"",
                                "type": "added"
                            },
                            {
                                "content": "        )",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "    def test_invalidation_flow(self):",
                                "type": "context"
                            },
                            {
                                "content": "        # pylint: disable=protected-access",
                                "type": "context"
                            },
                            {
                                "content": "        w = self.widget",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/unsupervised/tests/test_owtsne.py",
                            "type": "class",
                            "name": "TestOWtSNE",
                            "content": "class TestOWtSNE(WidgetTest, ProjectionWidgetTestMixin, WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n        cls.same_input_output_domain = False\n\n        cls.signal_name = OWtSNE.Inputs.data\n        cls.signal_data = cls.data\n\n    def setUp(self):\n        # For almost all the tests, we won't need to verify t-SNE validity and\n        # the tests will run much faster if we dummy them out\n        self.tsne = patch(\"Orange.projection.manifold.TSNE\", new=DummyTSNE)\n        self.tsne_model = patch(\"Orange.projection.manifold.TSNEModel\", new=DummyTSNEModel)\n        self.tsne.start()\n        self.tsne_model.start()\n\n        self.widget = self.create_widget(OWtSNE, stored_settings={\"multiscale\": False})\n\n        self.class_var = DiscreteVariable(\"Stage name\", values=(\"STG1\", \"STG2\"))\n        self.attributes = [ContinuousVariable(\"GeneName\" + str(i)) for i in range(5)]\n        self.domain = Domain(self.attributes, class_vars=self.class_var)\n        self.empty_domain = Domain([], class_vars=self.class_var)\n\n    def tearDown(self):\n        # Some tests may not wait for the widget to finish, and the patched\n        # methods might be unpatched before the widget finishes, resulting in\n        # a very confusing crash.\n        self.widget.onDeleteWidget()\n        try:\n            self.restore_mocked_functions()\n        # If `restore_mocked_functions` was called in the test itself, stopping\n        # the patchers here will raise a RuntimeError\n        except RuntimeError as e:\n            if str(e) != \"stop called on unstarted patcher\":\n                raise e\n\n    def restore_mocked_functions(self):\n        self.tsne.stop()\n        self.tsne_model.stop()\n\n    def test_wrong_input(self):\n        # no data\n        data = None\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n\n        # <2 rows\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_rows.is_shown())\n\n        # no attributes\n        data = Table.from_list(self.empty_domain, [['STG1']] * 2)\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_cols.is_shown())\n\n        # one attributes\n        data = Table.from_list(self.empty_domain, [[1, 'STG1'],\n                                                   [2, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_cols.is_shown())\n\n        # constant data\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1']] * 2)\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.constant_data.is_shown())\n\n        # correct input\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1'],\n                                             [5, 4, 3, 2, 1, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNotNone(self.widget.data)\n        self.assertFalse(self.widget.Error.not_enough_rows.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_cols.is_shown())\n        self.assertFalse(self.widget.Error.constant_data.is_shown())\n\n    def test_input(self):\n        data = Table.from_list(self.domain, [[1, 1, 1, 1, 1, 'STG1'],\n                                             [2, 2, 2, 2, 2, 'STG1'],\n                                             [4, 4, 4, 4, 4, 'STG2'],\n                                             [5, 5, 5, 5, 5, 'STG2']])\n\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n\n    def test_attr_models(self):\n        \"\"\"Check possible values for 'Color', 'Shape', 'Size' and 'Label'\"\"\"\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        controls = self.widget.controls\n        for var in self.data.domain.class_vars + self.data.domain.metas:\n            self.assertIn(var, controls.attr_color.model())\n            self.assertIn(var, controls.attr_label.model())\n            if var.is_continuous:\n                self.assertIn(var, controls.attr_size.model())\n                self.assertNotIn(var, controls.attr_shape.model())\n            if var.is_discrete:\n                self.assertNotIn(var, controls.attr_size.model())\n                self.assertIn(var, controls.attr_shape.model())\n\n    def test_multiscale_changed_updates_ui(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertFalse(self.widget.controls.multiscale.isChecked())\n        self.assertTrue(self.widget.perplexity_spin.isEnabled())\n        self.widget.controls.multiscale.setChecked(True)\n        self.assertFalse(self.widget.perplexity_spin.isEnabled())\n\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWtSNE, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        self.assertTrue(w.controls.multiscale.isChecked())\n        self.assertFalse(w.perplexity_spin.isEnabled())\n        w.onDeleteWidget()\n\n    def test_normalize_data(self):\n        # Normalization should be checked by default\n        self.assertTrue(self.widget.controls.normalize.isChecked())\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_called_once()\n\n        # Disable checkbox\n        self.widget.controls.normalize.setChecked(False)\n        self.assertFalse(self.widget.controls.normalize.isChecked())\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_not_called()\n\n        # Normalization shouldn't work on sparse data\n        self.widget.controls.normalize.setChecked(True)\n        self.assertTrue(self.widget.controls.normalize.isChecked())\n\n        sparse_data = self.data.to_sparse()\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, sparse_data)\n            self.assertFalse(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_not_called()\n\n    @patch(\"Orange.projection.manifold.TSNEModel.optimize\")\n    def test_exaggeration_is_passed_through_properly(self, optimize):\n        def _check_exaggeration(call, exaggeration):\n            # Check the last call to `optimize`, so we catch one during the\n            # regular regime\n            _, _, kwargs = call.mock_calls[-1]\n            self.assertIn(\"exaggeration\", kwargs)\n            self.assertEqual(kwargs[\"exaggeration\"], exaggeration)\n\n        # Since optimize needs to return a valid TSNEModel instance and it is\n        # impossible to return `self` in a mock, we'll prepare this one ahead\n        # of time and use this\n        optimize.return_value = DummyTSNE()(self.data)\n\n        # Set value to 1\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.run_button.clicked.emit()  # stop initial run\n        self.wait_until_stop_blocking()\n        self.widget.controls.exaggeration.setValue(1)\n        self.widget.run_button.clicked.emit()  # run with exaggeration 1\n        self.wait_until_finished()\n        _check_exaggeration(optimize, 1)\n\n        # Reset and clear state\n        self.send_signal(self.widget.Inputs.data, None)\n        optimize.reset_mock()\n\n        # Change to 3\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.run_button.clicked.emit()  # stop initial run\n        self.wait_until_stop_blocking()\n        self.widget.controls.exaggeration.setValue(3)\n        self.widget.run_button.clicked.emit()  # run with exaggeration 1\n        self.wait_until_finished()\n        _check_exaggeration(optimize, 3)\n\n    def test_plot_once(self):\n        \"\"\"Test if data is plotted only once but committed on every input change\"\"\"\n        self.widget.setup_plot = Mock()\n        self.widget.commit.deferred = self.widget.commit.now = Mock()\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        # TODO: The base widget immediately calls `setup_plot` and `commit`\n        # even though there's nothing to show yet. Unfortunately, fixing this\n        # would require changing `OWDataProjectionWidget` in some strange way,\n        # so as a temporary fix, we reset the mocks, so they reflect the calls\n        # when the result was available.\n        self.widget.setup_plot.reset_mock()\n        self.widget.commit.deferred.reset_mock()\n        self.wait_until_finished()\n\n        self.widget.setup_plot.assert_called_once()\n        self.widget.commit.deferred.assert_called_once()\n\n        self.widget.commit.deferred.reset_mock()\n        self.send_signal(self.widget.Inputs.data_subset, self.data[::10])\n        self.wait_until_stop_blocking()\n\n        self.widget.setup_plot.assert_called_once()\n        self.widget.commit.deferred.assert_called_once()\n\n    def test_modified_info_message_behaviour(self):\n        \"\"\"Information messages should be cleared if the data changes or if\n        the data is set to None.\"\"\"\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden by default\"\n        )\n\n        self.widget.controls.multiscale.setChecked(False)\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden even after toggling \"\n            \"options if no data is on input\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden after the widget \"\n            \"computes the embedding\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden when reloading the \"\n            \"same data set and no previous messages were shown\"\n        )\n\n        self.widget.controls.multiscale.setChecked(True)\n        self.assertTrue(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be shown when a setting is \"\n            \"changed, but the embedding is not recomputed\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, Table(\"housing\"))\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The information message was not cleared on new data\"\n        )\n        # Flip; the info message should now be shown again.\n        self.widget.controls.multiscale.setChecked(False)\n        assert self.widget.Information.modified.is_shown()  # sanity check\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The information message was not cleared on no data\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden after the widget \"\n            \"computes the embedding\"\n        )\n\n    def test_invalidation_flow(self):\n        # pylint: disable=protected-access\n        w = self.widget\n        # Setup widget: send data to input with global structure \"off\", then\n        # set global structure \"on\" (after the embedding is computed)\n        w.controls.multiscale.setChecked(False)\n        self.send_signal(w.Inputs.data, self.data)\n        self.wait_until_finished()\n        self.assertFalse(self.widget.Information.modified.is_shown())\n        # All the embedding components should be computed\n        self.assertIsNotNone(w.normalized_data)\n        self.assertIsNotNone(w.pca_projection)\n        self.assertIsNotNone(w.affinities)\n        self.assertIsNotNone(w.tsne_embedding)\n        # All the invalidation flags should be set to false\n        self.assertFalse(w._invalidated.normalized_data)\n        self.assertFalse(w._invalidated.pca_projection)\n        self.assertFalse(w._invalidated.affinities)\n        self.assertFalse(w._invalidated.tsne_embedding)\n\n        # Trigger invalidation\n        w.controls.multiscale.setChecked(True)\n        self.assertTrue(self.widget.Information.modified.is_shown())\n        # Setting `multiscale` to true should set the invalidate flags for\n        # the affinities and embedding, but not the pca_projection\n        self.assertFalse(w._invalidated.normalized_data)\n        self.assertFalse(w._invalidated.pca_projection)\n        self.assertTrue(w._invalidated.affinities)\n        self.assertTrue(w._invalidated.tsne_embedding)\n\n        # The flags should now be set, but the embedding should still be\n        # available when selecting a subset of data and such\n        self.assertIsNotNone(w.normalized_data)\n        self.assertIsNotNone(w.pca_projection)\n        self.assertIsNotNone(w.affinities)\n        self.assertIsNotNone(w.tsne_embedding)\n\n        # We should still be able to send a data subset to the input and have\n        # the points be highlighted\n        self.send_signal(w.Inputs.data_subset, self.data[:10])\n        self.wait_until_stop_blocking()\n        subset = [brush.color().name() == \"#46befa\" for brush in\n                  w.graph.scatterplot_item.data[\"brush\"][:10]]\n        other = [brush.color().name() == \"#000000\" for brush in\n                 w.graph.scatterplot_item.data[\"brush\"][10:]]\n        self.assertTrue(all(subset))\n        self.assertTrue(all(other))\n\n        # Clear the data subset\n        self.send_signal(w.Inputs.data_subset, None)\n\n        # Run the optimization\n        self.widget.run_button.clicked.emit()\n        self.wait_until_stop_blocking()\n        # All of the inavalidation flags should have been cleared\n        self.assertFalse(w._invalidated)\n\n    def test_pca_preprocessing_warning_with_large_number_of_features(self):\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden by default\"\n        )\n\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden even after toggling options if \"\n            \"no data is on input\"\n        )\n\n        # Setup data classes\n        x_small = np.random.normal(0, 1, size=(50, 4))\n        data_small = Table.from_numpy(Domain.from_numpy(x_small), x_small)\n        x_large = np.random.normal(0, 1, size=(50, 250))\n        data_large = Table.from_numpy(Domain.from_numpy(x_large), x_large)\n\n        # SMALL data with PCA preprocessing ENABLED\n        self.send_signal(self.widget.Inputs.data, data_small)\n        self.widget.controls.use_pca_preprocessing.setChecked(True)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden when PCA preprocessing enabled \"\n            \"when the data has <50 features\"\n        )\n\n        # SMALL data with PCA preprocessing DISABLED\n        self.send_signal(self.widget.Inputs.data, data_small)\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden with disabled PCA preprocessing \"\n            \"when the data has <50 features\"\n        )\n\n        # LARGE data with PCA preprocessing ENABLED\n        self.send_signal(self.widget.Inputs.data, data_large)\n        self.widget.controls.use_pca_preprocessing.setChecked(True)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden when PCA preprocessing enabled \"\n            \"when has >50 features\"\n        )\n\n        # LARGE data with PCA preprocessing DISABLED\n        self.send_signal(self.widget.Inputs.data, data_large)\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertTrue(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be shown when PCA preprocessing disabled \"\n            \"when the data has >50 features\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The PCA warning should be cleared when problematic data is removed\"\n        )",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 29,
                            "end_lineno": 428,
                            "parent": null
                        },
                        {
                            "file_name": "Orange/widgets/unsupervised/tests/test_owtsne.py",
                            "type": "method",
                            "name": "TestOWtSNE.test_modified_info_message_behaviour",
                            "content": "class TestOWtSNE(WidgetTest, ProjectionWidgetTestMixin, WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n        cls.same_input_output_domain = False\n\n        cls.signal_name = OWtSNE.Inputs.data\n        cls.signal_data = cls.data\n\n    def setUp(self):\n        # For almost all the tests, we won't need to verify t-SNE validity and\n        # the tests will run much faster if we dummy them out\n        self.tsne = patch(\"Orange.projection.manifold.TSNE\", new=DummyTSNE)\n        self.tsne_model = patch(\"Orange.projection.manifold.TSNEModel\", new=DummyTSNEModel)\n        self.tsne.start()\n        self.tsne_model.start()\n\n        self.widget = self.create_widget(OWtSNE, stored_settings={\"multiscale\": False})\n\n        self.class_var = DiscreteVariable(\"Stage name\", values=(\"STG1\", \"STG2\"))\n        self.attributes = [ContinuousVariable(\"GeneName\" + str(i)) for i in range(5)]\n        self.domain = Domain(self.attributes, class_vars=self.class_var)\n        self.empty_domain = Domain([], class_vars=self.class_var)\n\n    def tearDown(self):\n        # Some tests may not wait for the widget to finish, and the patched\n        # methods might be unpatched before the widget finishes, resulting in\n        # a very confusing crash.\n        self.widget.onDeleteWidget()\n        try:\n            self.restore_mocked_functions()\n        # If `restore_mocked_functions` was called in the test itself, stopping\n        # the patchers here will raise a RuntimeError\n        except RuntimeError as e:\n            if str(e) != \"stop called on unstarted patcher\":\n                raise e\n\n    def restore_mocked_functions(self):\n        self.tsne.stop()\n        self.tsne_model.stop()\n\n    def test_wrong_input(self):\n        # no data\n        data = None\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n\n        # <2 rows\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_rows.is_shown())\n\n        # no attributes\n        data = Table.from_list(self.empty_domain, [['STG1']] * 2)\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_cols.is_shown())\n\n        # one attributes\n        data = Table.from_list(self.empty_domain, [[1, 'STG1'],\n                                                   [2, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_cols.is_shown())\n\n        # constant data\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1']] * 2)\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.constant_data.is_shown())\n\n        # correct input\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1'],\n                                             [5, 4, 3, 2, 1, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNotNone(self.widget.data)\n        self.assertFalse(self.widget.Error.not_enough_rows.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_cols.is_shown())\n        self.assertFalse(self.widget.Error.constant_data.is_shown())\n\n    def test_input(self):\n        data = Table.from_list(self.domain, [[1, 1, 1, 1, 1, 'STG1'],\n                                             [2, 2, 2, 2, 2, 'STG1'],\n                                             [4, 4, 4, 4, 4, 'STG2'],\n                                             [5, 5, 5, 5, 5, 'STG2']])\n\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n\n    def test_attr_models(self):\n        \"\"\"Check possible values for 'Color', 'Shape', 'Size' and 'Label'\"\"\"\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        controls = self.widget.controls\n        for var in self.data.domain.class_vars + self.data.domain.metas:\n            self.assertIn(var, controls.attr_color.model())\n            self.assertIn(var, controls.attr_label.model())\n            if var.is_continuous:\n                self.assertIn(var, controls.attr_size.model())\n                self.assertNotIn(var, controls.attr_shape.model())\n            if var.is_discrete:\n                self.assertNotIn(var, controls.attr_size.model())\n                self.assertIn(var, controls.attr_shape.model())\n\n    def test_multiscale_changed_updates_ui(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertFalse(self.widget.controls.multiscale.isChecked())\n        self.assertTrue(self.widget.perplexity_spin.isEnabled())\n        self.widget.controls.multiscale.setChecked(True)\n        self.assertFalse(self.widget.perplexity_spin.isEnabled())\n\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWtSNE, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        self.assertTrue(w.controls.multiscale.isChecked())\n        self.assertFalse(w.perplexity_spin.isEnabled())\n        w.onDeleteWidget()\n\n    def test_normalize_data(self):\n        # Normalization should be checked by default\n        self.assertTrue(self.widget.controls.normalize.isChecked())\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_called_once()\n\n        # Disable checkbox\n        self.widget.controls.normalize.setChecked(False)\n        self.assertFalse(self.widget.controls.normalize.isChecked())\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_not_called()\n\n        # Normalization shouldn't work on sparse data\n        self.widget.controls.normalize.setChecked(True)\n        self.assertTrue(self.widget.controls.normalize.isChecked())\n\n        sparse_data = self.data.to_sparse()\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, sparse_data)\n            self.assertFalse(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_not_called()\n\n    @patch(\"Orange.projection.manifold.TSNEModel.optimize\")\n    def test_exaggeration_is_passed_through_properly(self, optimize):\n        def _check_exaggeration(call, exaggeration):\n            # Check the last call to `optimize`, so we catch one during the\n            # regular regime\n            _, _, kwargs = call.mock_calls[-1]\n            self.assertIn(\"exaggeration\", kwargs)\n            self.assertEqual(kwargs[\"exaggeration\"], exaggeration)\n\n        # Since optimize needs to return a valid TSNEModel instance and it is\n        # impossible to return `self` in a mock, we'll prepare this one ahead\n        # of time and use this\n        optimize.return_value = DummyTSNE()(self.data)\n\n        # Set value to 1\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.run_button.clicked.emit()  # stop initial run\n        self.wait_until_stop_blocking()\n        self.widget.controls.exaggeration.setValue(1)\n        self.widget.run_button.clicked.emit()  # run with exaggeration 1\n        self.wait_until_finished()\n        _check_exaggeration(optimize, 1)\n\n        # Reset and clear state\n        self.send_signal(self.widget.Inputs.data, None)\n        optimize.reset_mock()\n\n        # Change to 3\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.run_button.clicked.emit()  # stop initial run\n        self.wait_until_stop_blocking()\n        self.widget.controls.exaggeration.setValue(3)\n        self.widget.run_button.clicked.emit()  # run with exaggeration 1\n        self.wait_until_finished()\n        _check_exaggeration(optimize, 3)\n\n    def test_plot_once(self):\n        \"\"\"Test if data is plotted only once but committed on every input change\"\"\"\n        self.widget.setup_plot = Mock()\n        self.widget.commit.deferred = self.widget.commit.now = Mock()\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        # TODO: The base widget immediately calls `setup_plot` and `commit`\n        # even though there's nothing to show yet. Unfortunately, fixing this\n        # would require changing `OWDataProjectionWidget` in some strange way,\n        # so as a temporary fix, we reset the mocks, so they reflect the calls\n        # when the result was available.\n        self.widget.setup_plot.reset_mock()\n        self.widget.commit.deferred.reset_mock()\n        self.wait_until_finished()\n\n        self.widget.setup_plot.assert_called_once()\n        self.widget.commit.deferred.assert_called_once()\n\n        self.widget.commit.deferred.reset_mock()\n        self.send_signal(self.widget.Inputs.data_subset, self.data[::10])\n        self.wait_until_stop_blocking()\n\n        self.widget.setup_plot.assert_called_once()\n        self.widget.commit.deferred.assert_called_once()\n\n    def test_modified_info_message_behaviour(self):\n        \"\"\"Information messages should be cleared if the data changes or if\n        the data is set to None.\"\"\"\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden by default\"\n        )\n\n        self.widget.controls.multiscale.setChecked(False)\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden even after toggling \"\n            \"options if no data is on input\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden after the widget \"\n            \"computes the embedding\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden when reloading the \"\n            \"same data set and no previous messages were shown\"\n        )\n\n        self.widget.controls.multiscale.setChecked(True)\n        self.assertTrue(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be shown when a setting is \"\n            \"changed, but the embedding is not recomputed\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, Table(\"housing\"))\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The information message was not cleared on new data\"\n        )\n        # Flip; the info message should now be shown again.\n        self.widget.controls.multiscale.setChecked(False)\n        assert self.widget.Information.modified.is_shown()  # sanity check\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The information message was not cleared on no data\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden after the widget \"\n            \"computes the embedding\"\n        )\n\n    def test_invalidation_flow(self):\n        # pylint: disable=protected-access\n        w = self.widget\n        # Setup widget: send data to input with global structure \"off\", then\n        # set global structure \"on\" (after the embedding is computed)\n        w.controls.multiscale.setChecked(False)\n        self.send_signal(w.Inputs.data, self.data)\n        self.wait_until_finished()\n        self.assertFalse(self.widget.Information.modified.is_shown())\n        # All the embedding components should be computed\n        self.assertIsNotNone(w.normalized_data)\n        self.assertIsNotNone(w.pca_projection)\n        self.assertIsNotNone(w.affinities)\n        self.assertIsNotNone(w.tsne_embedding)\n        # All the invalidation flags should be set to false\n        self.assertFalse(w._invalidated.normalized_data)\n        self.assertFalse(w._invalidated.pca_projection)\n        self.assertFalse(w._invalidated.affinities)\n        self.assertFalse(w._invalidated.tsne_embedding)\n\n        # Trigger invalidation\n        w.controls.multiscale.setChecked(True)\n        self.assertTrue(self.widget.Information.modified.is_shown())\n        # Setting `multiscale` to true should set the invalidate flags for\n        # the affinities and embedding, but not the pca_projection\n        self.assertFalse(w._invalidated.normalized_data)\n        self.assertFalse(w._invalidated.pca_projection)\n        self.assertTrue(w._invalidated.affinities)\n        self.assertTrue(w._invalidated.tsne_embedding)\n\n        # The flags should now be set, but the embedding should still be\n        # available when selecting a subset of data and such\n        self.assertIsNotNone(w.normalized_data)\n        self.assertIsNotNone(w.pca_projection)\n        self.assertIsNotNone(w.affinities)\n        self.assertIsNotNone(w.tsne_embedding)\n\n        # We should still be able to send a data subset to the input and have\n        # the points be highlighted\n        self.send_signal(w.Inputs.data_subset, self.data[:10])\n        self.wait_until_stop_blocking()\n        subset = [brush.color().name() == \"#46befa\" for brush in\n                  w.graph.scatterplot_item.data[\"brush\"][:10]]\n        other = [brush.color().name() == \"#000000\" for brush in\n                 w.graph.scatterplot_item.data[\"brush\"][10:]]\n        self.assertTrue(all(subset))\n        self.assertTrue(all(other))\n\n        # Clear the data subset\n        self.send_signal(w.Inputs.data_subset, None)\n\n        # Run the optimization\n        self.widget.run_button.clicked.emit()\n        self.wait_until_stop_blocking()\n        # All of the inavalidation flags should have been cleared\n        self.assertFalse(w._invalidated)\n\n    def test_pca_preprocessing_warning_with_large_number_of_features(self):\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden by default\"\n        )\n\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden even after toggling options if \"\n            \"no data is on input\"\n        )\n\n        # Setup data classes\n        x_small = np.random.normal(0, 1, size=(50, 4))\n        data_small = Table.from_numpy(Domain.from_numpy(x_small), x_small)\n        x_large = np.random.normal(0, 1, size=(50, 250))\n        data_large = Table.from_numpy(Domain.from_numpy(x_large), x_large)\n\n        # SMALL data with PCA preprocessing ENABLED\n        self.send_signal(self.widget.Inputs.data, data_small)\n        self.widget.controls.use_pca_preprocessing.setChecked(True)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden when PCA preprocessing enabled \"\n            \"when the data has <50 features\"\n        )\n\n        # SMALL data with PCA preprocessing DISABLED\n        self.send_signal(self.widget.Inputs.data, data_small)\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden with disabled PCA preprocessing \"\n            \"when the data has <50 features\"\n        )\n\n        # LARGE data with PCA preprocessing ENABLED\n        self.send_signal(self.widget.Inputs.data, data_large)\n        self.widget.controls.use_pca_preprocessing.setChecked(True)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden when PCA preprocessing enabled \"\n            \"when has >50 features\"\n        )\n\n        # LARGE data with PCA preprocessing DISABLED\n        self.send_signal(self.widget.Inputs.data, data_large)\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertTrue(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be shown when PCA preprocessing disabled \"\n            \"when the data has >50 features\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The PCA warning should be cleared when problematic data is removed\"\n        )",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 245,
                            "end_lineno": 306,
                            "parent": {
                                "file_name": "Orange/widgets/unsupervised/tests/test_owtsne.py",
                                "type": "class",
                                "name": "TestOWtSNE",
                                "content": "class TestOWtSNE(WidgetTest, ProjectionWidgetTestMixin, WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n        cls.same_input_output_domain = False\n\n        cls.signal_name = OWtSNE.Inputs.data\n        cls.signal_data = cls.data\n\n    def setUp(self):\n        # For almost all the tests, we won't need to verify t-SNE validity and\n        # the tests will run much faster if we dummy them out\n        self.tsne = patch(\"Orange.projection.manifold.TSNE\", new=DummyTSNE)\n        self.tsne_model = patch(\"Orange.projection.manifold.TSNEModel\", new=DummyTSNEModel)\n        self.tsne.start()\n        self.tsne_model.start()\n\n        self.widget = self.create_widget(OWtSNE, stored_settings={\"multiscale\": False})\n\n        self.class_var = DiscreteVariable(\"Stage name\", values=(\"STG1\", \"STG2\"))\n        self.attributes = [ContinuousVariable(\"GeneName\" + str(i)) for i in range(5)]\n        self.domain = Domain(self.attributes, class_vars=self.class_var)\n        self.empty_domain = Domain([], class_vars=self.class_var)\n\n    def tearDown(self):\n        # Some tests may not wait for the widget to finish, and the patched\n        # methods might be unpatched before the widget finishes, resulting in\n        # a very confusing crash.\n        self.widget.onDeleteWidget()\n        try:\n            self.restore_mocked_functions()\n        # If `restore_mocked_functions` was called in the test itself, stopping\n        # the patchers here will raise a RuntimeError\n        except RuntimeError as e:\n            if str(e) != \"stop called on unstarted patcher\":\n                raise e\n\n    def restore_mocked_functions(self):\n        self.tsne.stop()\n        self.tsne_model.stop()\n\n    def test_wrong_input(self):\n        # no data\n        data = None\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n\n        # <2 rows\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_rows.is_shown())\n\n        # no attributes\n        data = Table.from_list(self.empty_domain, [['STG1']] * 2)\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_cols.is_shown())\n\n        # one attributes\n        data = Table.from_list(self.empty_domain, [[1, 'STG1'],\n                                                   [2, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_cols.is_shown())\n\n        # constant data\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1']] * 2)\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.constant_data.is_shown())\n\n        # correct input\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1'],\n                                             [5, 4, 3, 2, 1, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNotNone(self.widget.data)\n        self.assertFalse(self.widget.Error.not_enough_rows.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_cols.is_shown())\n        self.assertFalse(self.widget.Error.constant_data.is_shown())\n\n    def test_input(self):\n        data = Table.from_list(self.domain, [[1, 1, 1, 1, 1, 'STG1'],\n                                             [2, 2, 2, 2, 2, 'STG1'],\n                                             [4, 4, 4, 4, 4, 'STG2'],\n                                             [5, 5, 5, 5, 5, 'STG2']])\n\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n\n    def test_attr_models(self):\n        \"\"\"Check possible values for 'Color', 'Shape', 'Size' and 'Label'\"\"\"\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        controls = self.widget.controls\n        for var in self.data.domain.class_vars + self.data.domain.metas:\n            self.assertIn(var, controls.attr_color.model())\n            self.assertIn(var, controls.attr_label.model())\n            if var.is_continuous:\n                self.assertIn(var, controls.attr_size.model())\n                self.assertNotIn(var, controls.attr_shape.model())\n            if var.is_discrete:\n                self.assertNotIn(var, controls.attr_size.model())\n                self.assertIn(var, controls.attr_shape.model())\n\n    def test_multiscale_changed_updates_ui(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertFalse(self.widget.controls.multiscale.isChecked())\n        self.assertTrue(self.widget.perplexity_spin.isEnabled())\n        self.widget.controls.multiscale.setChecked(True)\n        self.assertFalse(self.widget.perplexity_spin.isEnabled())\n\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWtSNE, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        self.assertTrue(w.controls.multiscale.isChecked())\n        self.assertFalse(w.perplexity_spin.isEnabled())\n        w.onDeleteWidget()\n\n    def test_normalize_data(self):\n        # Normalization should be checked by default\n        self.assertTrue(self.widget.controls.normalize.isChecked())\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_called_once()\n\n        # Disable checkbox\n        self.widget.controls.normalize.setChecked(False)\n        self.assertFalse(self.widget.controls.normalize.isChecked())\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_not_called()\n\n        # Normalization shouldn't work on sparse data\n        self.widget.controls.normalize.setChecked(True)\n        self.assertTrue(self.widget.controls.normalize.isChecked())\n\n        sparse_data = self.data.to_sparse()\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, sparse_data)\n            self.assertFalse(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_not_called()\n\n    @patch(\"Orange.projection.manifold.TSNEModel.optimize\")\n    def test_exaggeration_is_passed_through_properly(self, optimize):\n        def _check_exaggeration(call, exaggeration):\n            # Check the last call to `optimize`, so we catch one during the\n            # regular regime\n            _, _, kwargs = call.mock_calls[-1]\n            self.assertIn(\"exaggeration\", kwargs)\n            self.assertEqual(kwargs[\"exaggeration\"], exaggeration)\n\n        # Since optimize needs to return a valid TSNEModel instance and it is\n        # impossible to return `self` in a mock, we'll prepare this one ahead\n        # of time and use this\n        optimize.return_value = DummyTSNE()(self.data)\n\n        # Set value to 1\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.run_button.clicked.emit()  # stop initial run\n        self.wait_until_stop_blocking()\n        self.widget.controls.exaggeration.setValue(1)\n        self.widget.run_button.clicked.emit()  # run with exaggeration 1\n        self.wait_until_finished()\n        _check_exaggeration(optimize, 1)\n\n        # Reset and clear state\n        self.send_signal(self.widget.Inputs.data, None)\n        optimize.reset_mock()\n\n        # Change to 3\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.run_button.clicked.emit()  # stop initial run\n        self.wait_until_stop_blocking()\n        self.widget.controls.exaggeration.setValue(3)\n        self.widget.run_button.clicked.emit()  # run with exaggeration 1\n        self.wait_until_finished()\n        _check_exaggeration(optimize, 3)\n\n    def test_plot_once(self):\n        \"\"\"Test if data is plotted only once but committed on every input change\"\"\"\n        self.widget.setup_plot = Mock()\n        self.widget.commit.deferred = self.widget.commit.now = Mock()\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        # TODO: The base widget immediately calls `setup_plot` and `commit`\n        # even though there's nothing to show yet. Unfortunately, fixing this\n        # would require changing `OWDataProjectionWidget` in some strange way,\n        # so as a temporary fix, we reset the mocks, so they reflect the calls\n        # when the result was available.\n        self.widget.setup_plot.reset_mock()\n        self.widget.commit.deferred.reset_mock()\n        self.wait_until_finished()\n\n        self.widget.setup_plot.assert_called_once()\n        self.widget.commit.deferred.assert_called_once()\n\n        self.widget.commit.deferred.reset_mock()\n        self.send_signal(self.widget.Inputs.data_subset, self.data[::10])\n        self.wait_until_stop_blocking()\n\n        self.widget.setup_plot.assert_called_once()\n        self.widget.commit.deferred.assert_called_once()\n\n    def test_modified_info_message_behaviour(self):\n        \"\"\"Information messages should be cleared if the data changes or if\n        the data is set to None.\"\"\"\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden by default\"\n        )\n\n        self.widget.controls.multiscale.setChecked(False)\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden even after toggling \"\n            \"options if no data is on input\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden after the widget \"\n            \"computes the embedding\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden when reloading the \"\n            \"same data set and no previous messages were shown\"\n        )\n\n        self.widget.controls.multiscale.setChecked(True)\n        self.assertTrue(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be shown when a setting is \"\n            \"changed, but the embedding is not recomputed\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, Table(\"housing\"))\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The information message was not cleared on new data\"\n        )\n        # Flip; the info message should now be shown again.\n        self.widget.controls.multiscale.setChecked(False)\n        assert self.widget.Information.modified.is_shown()  # sanity check\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The information message was not cleared on no data\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden after the widget \"\n            \"computes the embedding\"\n        )\n\n    def test_invalidation_flow(self):\n        # pylint: disable=protected-access\n        w = self.widget\n        # Setup widget: send data to input with global structure \"off\", then\n        # set global structure \"on\" (after the embedding is computed)\n        w.controls.multiscale.setChecked(False)\n        self.send_signal(w.Inputs.data, self.data)\n        self.wait_until_finished()\n        self.assertFalse(self.widget.Information.modified.is_shown())\n        # All the embedding components should be computed\n        self.assertIsNotNone(w.normalized_data)\n        self.assertIsNotNone(w.pca_projection)\n        self.assertIsNotNone(w.affinities)\n        self.assertIsNotNone(w.tsne_embedding)\n        # All the invalidation flags should be set to false\n        self.assertFalse(w._invalidated.normalized_data)\n        self.assertFalse(w._invalidated.pca_projection)\n        self.assertFalse(w._invalidated.affinities)\n        self.assertFalse(w._invalidated.tsne_embedding)\n\n        # Trigger invalidation\n        w.controls.multiscale.setChecked(True)\n        self.assertTrue(self.widget.Information.modified.is_shown())\n        # Setting `multiscale` to true should set the invalidate flags for\n        # the affinities and embedding, but not the pca_projection\n        self.assertFalse(w._invalidated.normalized_data)\n        self.assertFalse(w._invalidated.pca_projection)\n        self.assertTrue(w._invalidated.affinities)\n        self.assertTrue(w._invalidated.tsne_embedding)\n\n        # The flags should now be set, but the embedding should still be\n        # available when selecting a subset of data and such\n        self.assertIsNotNone(w.normalized_data)\n        self.assertIsNotNone(w.pca_projection)\n        self.assertIsNotNone(w.affinities)\n        self.assertIsNotNone(w.tsne_embedding)\n\n        # We should still be able to send a data subset to the input and have\n        # the points be highlighted\n        self.send_signal(w.Inputs.data_subset, self.data[:10])\n        self.wait_until_stop_blocking()\n        subset = [brush.color().name() == \"#46befa\" for brush in\n                  w.graph.scatterplot_item.data[\"brush\"][:10]]\n        other = [brush.color().name() == \"#000000\" for brush in\n                 w.graph.scatterplot_item.data[\"brush\"][10:]]\n        self.assertTrue(all(subset))\n        self.assertTrue(all(other))\n\n        # Clear the data subset\n        self.send_signal(w.Inputs.data_subset, None)\n\n        # Run the optimization\n        self.widget.run_button.clicked.emit()\n        self.wait_until_stop_blocking()\n        # All of the inavalidation flags should have been cleared\n        self.assertFalse(w._invalidated)\n\n    def test_pca_preprocessing_warning_with_large_number_of_features(self):\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden by default\"\n        )\n\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden even after toggling options if \"\n            \"no data is on input\"\n        )\n\n        # Setup data classes\n        x_small = np.random.normal(0, 1, size=(50, 4))\n        data_small = Table.from_numpy(Domain.from_numpy(x_small), x_small)\n        x_large = np.random.normal(0, 1, size=(50, 250))\n        data_large = Table.from_numpy(Domain.from_numpy(x_large), x_large)\n\n        # SMALL data with PCA preprocessing ENABLED\n        self.send_signal(self.widget.Inputs.data, data_small)\n        self.widget.controls.use_pca_preprocessing.setChecked(True)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden when PCA preprocessing enabled \"\n            \"when the data has <50 features\"\n        )\n\n        # SMALL data with PCA preprocessing DISABLED\n        self.send_signal(self.widget.Inputs.data, data_small)\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden with disabled PCA preprocessing \"\n            \"when the data has <50 features\"\n        )\n\n        # LARGE data with PCA preprocessing ENABLED\n        self.send_signal(self.widget.Inputs.data, data_large)\n        self.widget.controls.use_pca_preprocessing.setChecked(True)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden when PCA preprocessing enabled \"\n            \"when has >50 features\"\n        )\n\n        # LARGE data with PCA preprocessing DISABLED\n        self.send_signal(self.widget.Inputs.data, data_large)\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertTrue(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be shown when PCA preprocessing disabled \"\n            \"when the data has >50 features\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The PCA warning should be cleared when problematic data is removed\"\n        )",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 29,
                                "end_lineno": 428,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                },
                {
                    "descriptor": {
                        "old_range": {
                            "start": 354,
                            "length": 6
                        },
                        "new_range": {
                            "start": 362,
                            "length": 71
                        },
                        "section": "class TestOWtSNE(WidgetTest, ProjectionWidgetTestMixin, WidgetOutputsTestMixin):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        # All of the inavalidation flags should have been cleared",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertFalse(w._invalidated)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def test_pca_preprocessing_warning_with_large_number_of_features(self):",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(",
                                "type": "added"
                            },
                            {
                                "content": "            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),",
                                "type": "added"
                            },
                            {
                                "content": "            \"The PCA warning should be hidden by default\"",
                                "type": "added"
                            },
                            {
                                "content": "        )",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        self.widget.controls.use_pca_preprocessing.setChecked(False)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(",
                                "type": "added"
                            },
                            {
                                "content": "            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),",
                                "type": "added"
                            },
                            {
                                "content": "            \"The PCA warning should be hidden even after toggling options if \"",
                                "type": "added"
                            },
                            {
                                "content": "            \"no data is on input\"",
                                "type": "added"
                            },
                            {
                                "content": "        )",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        # Setup data classes",
                                "type": "added"
                            },
                            {
                                "content": "        x_small = np.random.normal(0, 1, size=(50, 4))",
                                "type": "added"
                            },
                            {
                                "content": "        data_small = Table.from_numpy(Domain.from_numpy(x_small), x_small)",
                                "type": "added"
                            },
                            {
                                "content": "        x_large = np.random.normal(0, 1, size=(50, 250))",
                                "type": "added"
                            },
                            {
                                "content": "        data_large = Table.from_numpy(Domain.from_numpy(x_large), x_large)",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        # SMALL data with PCA preprocessing ENABLED",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.data, data_small)",
                                "type": "added"
                            },
                            {
                                "content": "        self.widget.controls.use_pca_preprocessing.setChecked(True)",
                                "type": "added"
                            },
                            {
                                "content": "        self.widget.run_button.click(), self.wait_until_stop_blocking()",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(",
                                "type": "added"
                            },
                            {
                                "content": "            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),",
                                "type": "added"
                            },
                            {
                                "content": "            \"The PCA warning should be hidden when PCA preprocessing enabled \"",
                                "type": "added"
                            },
                            {
                                "content": "            \"when the data has <50 features\"",
                                "type": "added"
                            },
                            {
                                "content": "        )",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        # SMALL data with PCA preprocessing DISABLED",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.data, data_small)",
                                "type": "added"
                            },
                            {
                                "content": "        self.widget.controls.use_pca_preprocessing.setChecked(False)",
                                "type": "added"
                            },
                            {
                                "content": "        self.widget.run_button.click(), self.wait_until_stop_blocking()",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(",
                                "type": "added"
                            },
                            {
                                "content": "            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),",
                                "type": "added"
                            },
                            {
                                "content": "            \"The PCA warning should be hidden with disabled PCA preprocessing \"",
                                "type": "added"
                            },
                            {
                                "content": "            \"when the data has <50 features\"",
                                "type": "added"
                            },
                            {
                                "content": "        )",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        # LARGE data with PCA preprocessing ENABLED",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.data, data_large)",
                                "type": "added"
                            },
                            {
                                "content": "        self.widget.controls.use_pca_preprocessing.setChecked(True)",
                                "type": "added"
                            },
                            {
                                "content": "        self.widget.run_button.click(), self.wait_until_stop_blocking()",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(",
                                "type": "added"
                            },
                            {
                                "content": "            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),",
                                "type": "added"
                            },
                            {
                                "content": "            \"The PCA warning should be hidden when PCA preprocessing enabled \"",
                                "type": "added"
                            },
                            {
                                "content": "            \"when has >50 features\"",
                                "type": "added"
                            },
                            {
                                "content": "        )",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        # LARGE data with PCA preprocessing DISABLED",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.data, data_large)",
                                "type": "added"
                            },
                            {
                                "content": "        self.widget.controls.use_pca_preprocessing.setChecked(False)",
                                "type": "added"
                            },
                            {
                                "content": "        self.widget.run_button.click(), self.wait_until_stop_blocking()",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertTrue(",
                                "type": "added"
                            },
                            {
                                "content": "            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),",
                                "type": "added"
                            },
                            {
                                "content": "            \"The PCA warning should be shown when PCA preprocessing disabled \"",
                                "type": "added"
                            },
                            {
                                "content": "            \"when the data has >50 features\"",
                                "type": "added"
                            },
                            {
                                "content": "        )",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "        self.send_signal(self.widget.Inputs.data, None)",
                                "type": "added"
                            },
                            {
                                "content": "        self.assertFalse(",
                                "type": "added"
                            },
                            {
                                "content": "            self.widget.Information.modified.is_shown(),",
                                "type": "added"
                            },
                            {
                                "content": "            \"The PCA warning should be cleared when problematic data is removed\"",
                                "type": "added"
                            },
                            {
                                "content": "        )",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "class TestTSNERunner(unittest.TestCase):",
                                "type": "context"
                            },
                            {
                                "content": "    @classmethod",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "Orange/widgets/unsupervised/tests/test_owtsne.py",
                            "type": "class",
                            "name": "TestOWtSNE",
                            "content": "class TestOWtSNE(WidgetTest, ProjectionWidgetTestMixin, WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n        cls.same_input_output_domain = False\n\n        cls.signal_name = OWtSNE.Inputs.data\n        cls.signal_data = cls.data\n\n    def setUp(self):\n        # For almost all the tests, we won't need to verify t-SNE validity and\n        # the tests will run much faster if we dummy them out\n        self.tsne = patch(\"Orange.projection.manifold.TSNE\", new=DummyTSNE)\n        self.tsne_model = patch(\"Orange.projection.manifold.TSNEModel\", new=DummyTSNEModel)\n        self.tsne.start()\n        self.tsne_model.start()\n\n        self.widget = self.create_widget(OWtSNE, stored_settings={\"multiscale\": False})\n\n        self.class_var = DiscreteVariable(\"Stage name\", values=(\"STG1\", \"STG2\"))\n        self.attributes = [ContinuousVariable(\"GeneName\" + str(i)) for i in range(5)]\n        self.domain = Domain(self.attributes, class_vars=self.class_var)\n        self.empty_domain = Domain([], class_vars=self.class_var)\n\n    def tearDown(self):\n        # Some tests may not wait for the widget to finish, and the patched\n        # methods might be unpatched before the widget finishes, resulting in\n        # a very confusing crash.\n        self.widget.onDeleteWidget()\n        try:\n            self.restore_mocked_functions()\n        # If `restore_mocked_functions` was called in the test itself, stopping\n        # the patchers here will raise a RuntimeError\n        except RuntimeError as e:\n            if str(e) != \"stop called on unstarted patcher\":\n                raise e\n\n    def restore_mocked_functions(self):\n        self.tsne.stop()\n        self.tsne_model.stop()\n\n    def test_wrong_input(self):\n        # no data\n        data = None\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n\n        # <2 rows\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_rows.is_shown())\n\n        # no attributes\n        data = Table.from_list(self.empty_domain, [['STG1']] * 2)\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_cols.is_shown())\n\n        # one attributes\n        data = Table.from_list(self.empty_domain, [[1, 'STG1'],\n                                                   [2, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_cols.is_shown())\n\n        # constant data\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1']] * 2)\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.constant_data.is_shown())\n\n        # correct input\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1'],\n                                             [5, 4, 3, 2, 1, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNotNone(self.widget.data)\n        self.assertFalse(self.widget.Error.not_enough_rows.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_cols.is_shown())\n        self.assertFalse(self.widget.Error.constant_data.is_shown())\n\n    def test_input(self):\n        data = Table.from_list(self.domain, [[1, 1, 1, 1, 1, 'STG1'],\n                                             [2, 2, 2, 2, 2, 'STG1'],\n                                             [4, 4, 4, 4, 4, 'STG2'],\n                                             [5, 5, 5, 5, 5, 'STG2']])\n\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n\n    def test_attr_models(self):\n        \"\"\"Check possible values for 'Color', 'Shape', 'Size' and 'Label'\"\"\"\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        controls = self.widget.controls\n        for var in self.data.domain.class_vars + self.data.domain.metas:\n            self.assertIn(var, controls.attr_color.model())\n            self.assertIn(var, controls.attr_label.model())\n            if var.is_continuous:\n                self.assertIn(var, controls.attr_size.model())\n                self.assertNotIn(var, controls.attr_shape.model())\n            if var.is_discrete:\n                self.assertNotIn(var, controls.attr_size.model())\n                self.assertIn(var, controls.attr_shape.model())\n\n    def test_multiscale_changed_updates_ui(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertFalse(self.widget.controls.multiscale.isChecked())\n        self.assertTrue(self.widget.perplexity_spin.isEnabled())\n        self.widget.controls.multiscale.setChecked(True)\n        self.assertFalse(self.widget.perplexity_spin.isEnabled())\n\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWtSNE, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        self.assertTrue(w.controls.multiscale.isChecked())\n        self.assertFalse(w.perplexity_spin.isEnabled())\n        w.onDeleteWidget()\n\n    def test_normalize_data(self):\n        # Normalization should be checked by default\n        self.assertTrue(self.widget.controls.normalize.isChecked())\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_called_once()\n\n        # Disable checkbox\n        self.widget.controls.normalize.setChecked(False)\n        self.assertFalse(self.widget.controls.normalize.isChecked())\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_not_called()\n\n        # Normalization shouldn't work on sparse data\n        self.widget.controls.normalize.setChecked(True)\n        self.assertTrue(self.widget.controls.normalize.isChecked())\n\n        sparse_data = self.data.to_sparse()\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, sparse_data)\n            self.assertFalse(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_not_called()\n\n    @patch(\"Orange.projection.manifold.TSNEModel.optimize\")\n    def test_exaggeration_is_passed_through_properly(self, optimize):\n        def _check_exaggeration(call, exaggeration):\n            # Check the last call to `optimize`, so we catch one during the\n            # regular regime\n            _, _, kwargs = call.mock_calls[-1]\n            self.assertIn(\"exaggeration\", kwargs)\n            self.assertEqual(kwargs[\"exaggeration\"], exaggeration)\n\n        # Since optimize needs to return a valid TSNEModel instance and it is\n        # impossible to return `self` in a mock, we'll prepare this one ahead\n        # of time and use this\n        optimize.return_value = DummyTSNE()(self.data)\n\n        # Set value to 1\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.run_button.clicked.emit()  # stop initial run\n        self.wait_until_stop_blocking()\n        self.widget.controls.exaggeration.setValue(1)\n        self.widget.run_button.clicked.emit()  # run with exaggeration 1\n        self.wait_until_finished()\n        _check_exaggeration(optimize, 1)\n\n        # Reset and clear state\n        self.send_signal(self.widget.Inputs.data, None)\n        optimize.reset_mock()\n\n        # Change to 3\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.run_button.clicked.emit()  # stop initial run\n        self.wait_until_stop_blocking()\n        self.widget.controls.exaggeration.setValue(3)\n        self.widget.run_button.clicked.emit()  # run with exaggeration 1\n        self.wait_until_finished()\n        _check_exaggeration(optimize, 3)\n\n    def test_plot_once(self):\n        \"\"\"Test if data is plotted only once but committed on every input change\"\"\"\n        self.widget.setup_plot = Mock()\n        self.widget.commit.deferred = self.widget.commit.now = Mock()\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        # TODO: The base widget immediately calls `setup_plot` and `commit`\n        # even though there's nothing to show yet. Unfortunately, fixing this\n        # would require changing `OWDataProjectionWidget` in some strange way,\n        # so as a temporary fix, we reset the mocks, so they reflect the calls\n        # when the result was available.\n        self.widget.setup_plot.reset_mock()\n        self.widget.commit.deferred.reset_mock()\n        self.wait_until_finished()\n\n        self.widget.setup_plot.assert_called_once()\n        self.widget.commit.deferred.assert_called_once()\n\n        self.widget.commit.deferred.reset_mock()\n        self.send_signal(self.widget.Inputs.data_subset, self.data[::10])\n        self.wait_until_stop_blocking()\n\n        self.widget.setup_plot.assert_called_once()\n        self.widget.commit.deferred.assert_called_once()\n\n    def test_modified_info_message_behaviour(self):\n        \"\"\"Information messages should be cleared if the data changes or if\n        the data is set to None.\"\"\"\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden by default\"\n        )\n\n        self.widget.controls.multiscale.setChecked(False)\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden even after toggling \"\n            \"options if no data is on input\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden after the widget \"\n            \"computes the embedding\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden when reloading the \"\n            \"same data set and no previous messages were shown\"\n        )\n\n        self.widget.controls.multiscale.setChecked(True)\n        self.assertTrue(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be shown when a setting is \"\n            \"changed, but the embedding is not recomputed\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, Table(\"housing\"))\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The information message was not cleared on new data\"\n        )\n        # Flip; the info message should now be shown again.\n        self.widget.controls.multiscale.setChecked(False)\n        assert self.widget.Information.modified.is_shown()  # sanity check\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The information message was not cleared on no data\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden after the widget \"\n            \"computes the embedding\"\n        )\n\n    def test_invalidation_flow(self):\n        # pylint: disable=protected-access\n        w = self.widget\n        # Setup widget: send data to input with global structure \"off\", then\n        # set global structure \"on\" (after the embedding is computed)\n        w.controls.multiscale.setChecked(False)\n        self.send_signal(w.Inputs.data, self.data)\n        self.wait_until_finished()\n        self.assertFalse(self.widget.Information.modified.is_shown())\n        # All the embedding components should be computed\n        self.assertIsNotNone(w.normalized_data)\n        self.assertIsNotNone(w.pca_projection)\n        self.assertIsNotNone(w.affinities)\n        self.assertIsNotNone(w.tsne_embedding)\n        # All the invalidation flags should be set to false\n        self.assertFalse(w._invalidated.normalized_data)\n        self.assertFalse(w._invalidated.pca_projection)\n        self.assertFalse(w._invalidated.affinities)\n        self.assertFalse(w._invalidated.tsne_embedding)\n\n        # Trigger invalidation\n        w.controls.multiscale.setChecked(True)\n        self.assertTrue(self.widget.Information.modified.is_shown())\n        # Setting `multiscale` to true should set the invalidate flags for\n        # the affinities and embedding, but not the pca_projection\n        self.assertFalse(w._invalidated.normalized_data)\n        self.assertFalse(w._invalidated.pca_projection)\n        self.assertTrue(w._invalidated.affinities)\n        self.assertTrue(w._invalidated.tsne_embedding)\n\n        # The flags should now be set, but the embedding should still be\n        # available when selecting a subset of data and such\n        self.assertIsNotNone(w.normalized_data)\n        self.assertIsNotNone(w.pca_projection)\n        self.assertIsNotNone(w.affinities)\n        self.assertIsNotNone(w.tsne_embedding)\n\n        # We should still be able to send a data subset to the input and have\n        # the points be highlighted\n        self.send_signal(w.Inputs.data_subset, self.data[:10])\n        self.wait_until_stop_blocking()\n        subset = [brush.color().name() == \"#46befa\" for brush in\n                  w.graph.scatterplot_item.data[\"brush\"][:10]]\n        other = [brush.color().name() == \"#000000\" for brush in\n                 w.graph.scatterplot_item.data[\"brush\"][10:]]\n        self.assertTrue(all(subset))\n        self.assertTrue(all(other))\n\n        # Clear the data subset\n        self.send_signal(w.Inputs.data_subset, None)\n\n        # Run the optimization\n        self.widget.run_button.clicked.emit()\n        self.wait_until_stop_blocking()\n        # All of the inavalidation flags should have been cleared\n        self.assertFalse(w._invalidated)\n\n    def test_pca_preprocessing_warning_with_large_number_of_features(self):\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden by default\"\n        )\n\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden even after toggling options if \"\n            \"no data is on input\"\n        )\n\n        # Setup data classes\n        x_small = np.random.normal(0, 1, size=(50, 4))\n        data_small = Table.from_numpy(Domain.from_numpy(x_small), x_small)\n        x_large = np.random.normal(0, 1, size=(50, 250))\n        data_large = Table.from_numpy(Domain.from_numpy(x_large), x_large)\n\n        # SMALL data with PCA preprocessing ENABLED\n        self.send_signal(self.widget.Inputs.data, data_small)\n        self.widget.controls.use_pca_preprocessing.setChecked(True)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden when PCA preprocessing enabled \"\n            \"when the data has <50 features\"\n        )\n\n        # SMALL data with PCA preprocessing DISABLED\n        self.send_signal(self.widget.Inputs.data, data_small)\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden with disabled PCA preprocessing \"\n            \"when the data has <50 features\"\n        )\n\n        # LARGE data with PCA preprocessing ENABLED\n        self.send_signal(self.widget.Inputs.data, data_large)\n        self.widget.controls.use_pca_preprocessing.setChecked(True)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden when PCA preprocessing enabled \"\n            \"when has >50 features\"\n        )\n\n        # LARGE data with PCA preprocessing DISABLED\n        self.send_signal(self.widget.Inputs.data, data_large)\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertTrue(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be shown when PCA preprocessing disabled \"\n            \"when the data has >50 features\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The PCA warning should be cleared when problematic data is removed\"\n        )",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 29,
                            "end_lineno": 428,
                            "parent": null
                        }
                    ],
                    "added_entities": [
                        {
                            "file_name": "Orange/widgets/unsupervised/tests/test_owtsne.py",
                            "type": "method",
                            "name": "TestOWtSNE.test_pca_preprocessing_warning_with_large_number_of_features",
                            "content": "class TestOWtSNE(WidgetTest, ProjectionWidgetTestMixin, WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n        cls.same_input_output_domain = False\n\n        cls.signal_name = OWtSNE.Inputs.data\n        cls.signal_data = cls.data\n\n    def setUp(self):\n        # For almost all the tests, we won't need to verify t-SNE validity and\n        # the tests will run much faster if we dummy them out\n        self.tsne = patch(\"Orange.projection.manifold.TSNE\", new=DummyTSNE)\n        self.tsne_model = patch(\"Orange.projection.manifold.TSNEModel\", new=DummyTSNEModel)\n        self.tsne.start()\n        self.tsne_model.start()\n\n        self.widget = self.create_widget(OWtSNE, stored_settings={\"multiscale\": False})\n\n        self.class_var = DiscreteVariable(\"Stage name\", values=(\"STG1\", \"STG2\"))\n        self.attributes = [ContinuousVariable(\"GeneName\" + str(i)) for i in range(5)]\n        self.domain = Domain(self.attributes, class_vars=self.class_var)\n        self.empty_domain = Domain([], class_vars=self.class_var)\n\n    def tearDown(self):\n        # Some tests may not wait for the widget to finish, and the patched\n        # methods might be unpatched before the widget finishes, resulting in\n        # a very confusing crash.\n        self.widget.onDeleteWidget()\n        try:\n            self.restore_mocked_functions()\n        # If `restore_mocked_functions` was called in the test itself, stopping\n        # the patchers here will raise a RuntimeError\n        except RuntimeError as e:\n            if str(e) != \"stop called on unstarted patcher\":\n                raise e\n\n    def restore_mocked_functions(self):\n        self.tsne.stop()\n        self.tsne_model.stop()\n\n    def test_wrong_input(self):\n        # no data\n        data = None\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n\n        # <2 rows\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_rows.is_shown())\n\n        # no attributes\n        data = Table.from_list(self.empty_domain, [['STG1']] * 2)\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_cols.is_shown())\n\n        # one attributes\n        data = Table.from_list(self.empty_domain, [[1, 'STG1'],\n                                                   [2, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_cols.is_shown())\n\n        # constant data\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1']] * 2)\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.constant_data.is_shown())\n\n        # correct input\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1'],\n                                             [5, 4, 3, 2, 1, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNotNone(self.widget.data)\n        self.assertFalse(self.widget.Error.not_enough_rows.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_cols.is_shown())\n        self.assertFalse(self.widget.Error.constant_data.is_shown())\n\n    def test_input(self):\n        data = Table.from_list(self.domain, [[1, 1, 1, 1, 1, 'STG1'],\n                                             [2, 2, 2, 2, 2, 'STG1'],\n                                             [4, 4, 4, 4, 4, 'STG2'],\n                                             [5, 5, 5, 5, 5, 'STG2']])\n\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n\n    def test_attr_models(self):\n        \"\"\"Check possible values for 'Color', 'Shape', 'Size' and 'Label'\"\"\"\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        controls = self.widget.controls\n        for var in self.data.domain.class_vars + self.data.domain.metas:\n            self.assertIn(var, controls.attr_color.model())\n            self.assertIn(var, controls.attr_label.model())\n            if var.is_continuous:\n                self.assertIn(var, controls.attr_size.model())\n                self.assertNotIn(var, controls.attr_shape.model())\n            if var.is_discrete:\n                self.assertNotIn(var, controls.attr_size.model())\n                self.assertIn(var, controls.attr_shape.model())\n\n    def test_multiscale_changed_updates_ui(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertFalse(self.widget.controls.multiscale.isChecked())\n        self.assertTrue(self.widget.perplexity_spin.isEnabled())\n        self.widget.controls.multiscale.setChecked(True)\n        self.assertFalse(self.widget.perplexity_spin.isEnabled())\n\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWtSNE, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        self.assertTrue(w.controls.multiscale.isChecked())\n        self.assertFalse(w.perplexity_spin.isEnabled())\n        w.onDeleteWidget()\n\n    def test_normalize_data(self):\n        # Normalization should be checked by default\n        self.assertTrue(self.widget.controls.normalize.isChecked())\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_called_once()\n\n        # Disable checkbox\n        self.widget.controls.normalize.setChecked(False)\n        self.assertFalse(self.widget.controls.normalize.isChecked())\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_not_called()\n\n        # Normalization shouldn't work on sparse data\n        self.widget.controls.normalize.setChecked(True)\n        self.assertTrue(self.widget.controls.normalize.isChecked())\n\n        sparse_data = self.data.to_sparse()\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, sparse_data)\n            self.assertFalse(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_not_called()\n\n    @patch(\"Orange.projection.manifold.TSNEModel.optimize\")\n    def test_exaggeration_is_passed_through_properly(self, optimize):\n        def _check_exaggeration(call, exaggeration):\n            # Check the last call to `optimize`, so we catch one during the\n            # regular regime\n            _, _, kwargs = call.mock_calls[-1]\n            self.assertIn(\"exaggeration\", kwargs)\n            self.assertEqual(kwargs[\"exaggeration\"], exaggeration)\n\n        # Since optimize needs to return a valid TSNEModel instance and it is\n        # impossible to return `self` in a mock, we'll prepare this one ahead\n        # of time and use this\n        optimize.return_value = DummyTSNE()(self.data)\n\n        # Set value to 1\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.run_button.clicked.emit()  # stop initial run\n        self.wait_until_stop_blocking()\n        self.widget.controls.exaggeration.setValue(1)\n        self.widget.run_button.clicked.emit()  # run with exaggeration 1\n        self.wait_until_finished()\n        _check_exaggeration(optimize, 1)\n\n        # Reset and clear state\n        self.send_signal(self.widget.Inputs.data, None)\n        optimize.reset_mock()\n\n        # Change to 3\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.run_button.clicked.emit()  # stop initial run\n        self.wait_until_stop_blocking()\n        self.widget.controls.exaggeration.setValue(3)\n        self.widget.run_button.clicked.emit()  # run with exaggeration 1\n        self.wait_until_finished()\n        _check_exaggeration(optimize, 3)\n\n    def test_plot_once(self):\n        \"\"\"Test if data is plotted only once but committed on every input change\"\"\"\n        self.widget.setup_plot = Mock()\n        self.widget.commit.deferred = self.widget.commit.now = Mock()\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        # TODO: The base widget immediately calls `setup_plot` and `commit`\n        # even though there's nothing to show yet. Unfortunately, fixing this\n        # would require changing `OWDataProjectionWidget` in some strange way,\n        # so as a temporary fix, we reset the mocks, so they reflect the calls\n        # when the result was available.\n        self.widget.setup_plot.reset_mock()\n        self.widget.commit.deferred.reset_mock()\n        self.wait_until_finished()\n\n        self.widget.setup_plot.assert_called_once()\n        self.widget.commit.deferred.assert_called_once()\n\n        self.widget.commit.deferred.reset_mock()\n        self.send_signal(self.widget.Inputs.data_subset, self.data[::10])\n        self.wait_until_stop_blocking()\n\n        self.widget.setup_plot.assert_called_once()\n        self.widget.commit.deferred.assert_called_once()\n\n    def test_modified_info_message_behaviour(self):\n        \"\"\"Information messages should be cleared if the data changes or if\n        the data is set to None.\"\"\"\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden by default\"\n        )\n\n        self.widget.controls.multiscale.setChecked(False)\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden even after toggling \"\n            \"options if no data is on input\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden after the widget \"\n            \"computes the embedding\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden when reloading the \"\n            \"same data set and no previous messages were shown\"\n        )\n\n        self.widget.controls.multiscale.setChecked(True)\n        self.assertTrue(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be shown when a setting is \"\n            \"changed, but the embedding is not recomputed\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, Table(\"housing\"))\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The information message was not cleared on new data\"\n        )\n        # Flip; the info message should now be shown again.\n        self.widget.controls.multiscale.setChecked(False)\n        assert self.widget.Information.modified.is_shown()  # sanity check\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The information message was not cleared on no data\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden after the widget \"\n            \"computes the embedding\"\n        )\n\n    def test_invalidation_flow(self):\n        # pylint: disable=protected-access\n        w = self.widget\n        # Setup widget: send data to input with global structure \"off\", then\n        # set global structure \"on\" (after the embedding is computed)\n        w.controls.multiscale.setChecked(False)\n        self.send_signal(w.Inputs.data, self.data)\n        self.wait_until_finished()\n        self.assertFalse(self.widget.Information.modified.is_shown())\n        # All the embedding components should be computed\n        self.assertIsNotNone(w.normalized_data)\n        self.assertIsNotNone(w.pca_projection)\n        self.assertIsNotNone(w.affinities)\n        self.assertIsNotNone(w.tsne_embedding)\n        # All the invalidation flags should be set to false\n        self.assertFalse(w._invalidated.normalized_data)\n        self.assertFalse(w._invalidated.pca_projection)\n        self.assertFalse(w._invalidated.affinities)\n        self.assertFalse(w._invalidated.tsne_embedding)\n\n        # Trigger invalidation\n        w.controls.multiscale.setChecked(True)\n        self.assertTrue(self.widget.Information.modified.is_shown())\n        # Setting `multiscale` to true should set the invalidate flags for\n        # the affinities and embedding, but not the pca_projection\n        self.assertFalse(w._invalidated.normalized_data)\n        self.assertFalse(w._invalidated.pca_projection)\n        self.assertTrue(w._invalidated.affinities)\n        self.assertTrue(w._invalidated.tsne_embedding)\n\n        # The flags should now be set, but the embedding should still be\n        # available when selecting a subset of data and such\n        self.assertIsNotNone(w.normalized_data)\n        self.assertIsNotNone(w.pca_projection)\n        self.assertIsNotNone(w.affinities)\n        self.assertIsNotNone(w.tsne_embedding)\n\n        # We should still be able to send a data subset to the input and have\n        # the points be highlighted\n        self.send_signal(w.Inputs.data_subset, self.data[:10])\n        self.wait_until_stop_blocking()\n        subset = [brush.color().name() == \"#46befa\" for brush in\n                  w.graph.scatterplot_item.data[\"brush\"][:10]]\n        other = [brush.color().name() == \"#000000\" for brush in\n                 w.graph.scatterplot_item.data[\"brush\"][10:]]\n        self.assertTrue(all(subset))\n        self.assertTrue(all(other))\n\n        # Clear the data subset\n        self.send_signal(w.Inputs.data_subset, None)\n\n        # Run the optimization\n        self.widget.run_button.clicked.emit()\n        self.wait_until_stop_blocking()\n        # All of the inavalidation flags should have been cleared\n        self.assertFalse(w._invalidated)\n\n    def test_pca_preprocessing_warning_with_large_number_of_features(self):\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden by default\"\n        )\n\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden even after toggling options if \"\n            \"no data is on input\"\n        )\n\n        # Setup data classes\n        x_small = np.random.normal(0, 1, size=(50, 4))\n        data_small = Table.from_numpy(Domain.from_numpy(x_small), x_small)\n        x_large = np.random.normal(0, 1, size=(50, 250))\n        data_large = Table.from_numpy(Domain.from_numpy(x_large), x_large)\n\n        # SMALL data with PCA preprocessing ENABLED\n        self.send_signal(self.widget.Inputs.data, data_small)\n        self.widget.controls.use_pca_preprocessing.setChecked(True)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden when PCA preprocessing enabled \"\n            \"when the data has <50 features\"\n        )\n\n        # SMALL data with PCA preprocessing DISABLED\n        self.send_signal(self.widget.Inputs.data, data_small)\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden with disabled PCA preprocessing \"\n            \"when the data has <50 features\"\n        )\n\n        # LARGE data with PCA preprocessing ENABLED\n        self.send_signal(self.widget.Inputs.data, data_large)\n        self.widget.controls.use_pca_preprocessing.setChecked(True)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden when PCA preprocessing enabled \"\n            \"when has >50 features\"\n        )\n\n        # LARGE data with PCA preprocessing DISABLED\n        self.send_signal(self.widget.Inputs.data, data_large)\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertTrue(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be shown when PCA preprocessing disabled \"\n            \"when the data has >50 features\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The PCA warning should be cleared when problematic data is removed\"\n        )",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 365,
                            "end_lineno": 428,
                            "parent": {
                                "file_name": "Orange/widgets/unsupervised/tests/test_owtsne.py",
                                "type": "class",
                                "name": "TestOWtSNE",
                                "content": "class TestOWtSNE(WidgetTest, ProjectionWidgetTestMixin, WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n        cls.same_input_output_domain = False\n\n        cls.signal_name = OWtSNE.Inputs.data\n        cls.signal_data = cls.data\n\n    def setUp(self):\n        # For almost all the tests, we won't need to verify t-SNE validity and\n        # the tests will run much faster if we dummy them out\n        self.tsne = patch(\"Orange.projection.manifold.TSNE\", new=DummyTSNE)\n        self.tsne_model = patch(\"Orange.projection.manifold.TSNEModel\", new=DummyTSNEModel)\n        self.tsne.start()\n        self.tsne_model.start()\n\n        self.widget = self.create_widget(OWtSNE, stored_settings={\"multiscale\": False})\n\n        self.class_var = DiscreteVariable(\"Stage name\", values=(\"STG1\", \"STG2\"))\n        self.attributes = [ContinuousVariable(\"GeneName\" + str(i)) for i in range(5)]\n        self.domain = Domain(self.attributes, class_vars=self.class_var)\n        self.empty_domain = Domain([], class_vars=self.class_var)\n\n    def tearDown(self):\n        # Some tests may not wait for the widget to finish, and the patched\n        # methods might be unpatched before the widget finishes, resulting in\n        # a very confusing crash.\n        self.widget.onDeleteWidget()\n        try:\n            self.restore_mocked_functions()\n        # If `restore_mocked_functions` was called in the test itself, stopping\n        # the patchers here will raise a RuntimeError\n        except RuntimeError as e:\n            if str(e) != \"stop called on unstarted patcher\":\n                raise e\n\n    def restore_mocked_functions(self):\n        self.tsne.stop()\n        self.tsne_model.stop()\n\n    def test_wrong_input(self):\n        # no data\n        data = None\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n\n        # <2 rows\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_rows.is_shown())\n\n        # no attributes\n        data = Table.from_list(self.empty_domain, [['STG1']] * 2)\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_cols.is_shown())\n\n        # one attributes\n        data = Table.from_list(self.empty_domain, [[1, 'STG1'],\n                                                   [2, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_cols.is_shown())\n\n        # constant data\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1']] * 2)\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.constant_data.is_shown())\n\n        # correct input\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1'],\n                                             [5, 4, 3, 2, 1, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNotNone(self.widget.data)\n        self.assertFalse(self.widget.Error.not_enough_rows.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_cols.is_shown())\n        self.assertFalse(self.widget.Error.constant_data.is_shown())\n\n    def test_input(self):\n        data = Table.from_list(self.domain, [[1, 1, 1, 1, 1, 'STG1'],\n                                             [2, 2, 2, 2, 2, 'STG1'],\n                                             [4, 4, 4, 4, 4, 'STG2'],\n                                             [5, 5, 5, 5, 5, 'STG2']])\n\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n\n    def test_attr_models(self):\n        \"\"\"Check possible values for 'Color', 'Shape', 'Size' and 'Label'\"\"\"\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        controls = self.widget.controls\n        for var in self.data.domain.class_vars + self.data.domain.metas:\n            self.assertIn(var, controls.attr_color.model())\n            self.assertIn(var, controls.attr_label.model())\n            if var.is_continuous:\n                self.assertIn(var, controls.attr_size.model())\n                self.assertNotIn(var, controls.attr_shape.model())\n            if var.is_discrete:\n                self.assertNotIn(var, controls.attr_size.model())\n                self.assertIn(var, controls.attr_shape.model())\n\n    def test_multiscale_changed_updates_ui(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertFalse(self.widget.controls.multiscale.isChecked())\n        self.assertTrue(self.widget.perplexity_spin.isEnabled())\n        self.widget.controls.multiscale.setChecked(True)\n        self.assertFalse(self.widget.perplexity_spin.isEnabled())\n\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWtSNE, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        self.assertTrue(w.controls.multiscale.isChecked())\n        self.assertFalse(w.perplexity_spin.isEnabled())\n        w.onDeleteWidget()\n\n    def test_normalize_data(self):\n        # Normalization should be checked by default\n        self.assertTrue(self.widget.controls.normalize.isChecked())\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_called_once()\n\n        # Disable checkbox\n        self.widget.controls.normalize.setChecked(False)\n        self.assertFalse(self.widget.controls.normalize.isChecked())\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_not_called()\n\n        # Normalization shouldn't work on sparse data\n        self.widget.controls.normalize.setChecked(True)\n        self.assertTrue(self.widget.controls.normalize.isChecked())\n\n        sparse_data = self.data.to_sparse()\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, sparse_data)\n            self.assertFalse(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_not_called()\n\n    @patch(\"Orange.projection.manifold.TSNEModel.optimize\")\n    def test_exaggeration_is_passed_through_properly(self, optimize):\n        def _check_exaggeration(call, exaggeration):\n            # Check the last call to `optimize`, so we catch one during the\n            # regular regime\n            _, _, kwargs = call.mock_calls[-1]\n            self.assertIn(\"exaggeration\", kwargs)\n            self.assertEqual(kwargs[\"exaggeration\"], exaggeration)\n\n        # Since optimize needs to return a valid TSNEModel instance and it is\n        # impossible to return `self` in a mock, we'll prepare this one ahead\n        # of time and use this\n        optimize.return_value = DummyTSNE()(self.data)\n\n        # Set value to 1\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.run_button.clicked.emit()  # stop initial run\n        self.wait_until_stop_blocking()\n        self.widget.controls.exaggeration.setValue(1)\n        self.widget.run_button.clicked.emit()  # run with exaggeration 1\n        self.wait_until_finished()\n        _check_exaggeration(optimize, 1)\n\n        # Reset and clear state\n        self.send_signal(self.widget.Inputs.data, None)\n        optimize.reset_mock()\n\n        # Change to 3\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.run_button.clicked.emit()  # stop initial run\n        self.wait_until_stop_blocking()\n        self.widget.controls.exaggeration.setValue(3)\n        self.widget.run_button.clicked.emit()  # run with exaggeration 1\n        self.wait_until_finished()\n        _check_exaggeration(optimize, 3)\n\n    def test_plot_once(self):\n        \"\"\"Test if data is plotted only once but committed on every input change\"\"\"\n        self.widget.setup_plot = Mock()\n        self.widget.commit.deferred = self.widget.commit.now = Mock()\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        # TODO: The base widget immediately calls `setup_plot` and `commit`\n        # even though there's nothing to show yet. Unfortunately, fixing this\n        # would require changing `OWDataProjectionWidget` in some strange way,\n        # so as a temporary fix, we reset the mocks, so they reflect the calls\n        # when the result was available.\n        self.widget.setup_plot.reset_mock()\n        self.widget.commit.deferred.reset_mock()\n        self.wait_until_finished()\n\n        self.widget.setup_plot.assert_called_once()\n        self.widget.commit.deferred.assert_called_once()\n\n        self.widget.commit.deferred.reset_mock()\n        self.send_signal(self.widget.Inputs.data_subset, self.data[::10])\n        self.wait_until_stop_blocking()\n\n        self.widget.setup_plot.assert_called_once()\n        self.widget.commit.deferred.assert_called_once()\n\n    def test_modified_info_message_behaviour(self):\n        \"\"\"Information messages should be cleared if the data changes or if\n        the data is set to None.\"\"\"\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden by default\"\n        )\n\n        self.widget.controls.multiscale.setChecked(False)\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden even after toggling \"\n            \"options if no data is on input\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden after the widget \"\n            \"computes the embedding\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden when reloading the \"\n            \"same data set and no previous messages were shown\"\n        )\n\n        self.widget.controls.multiscale.setChecked(True)\n        self.assertTrue(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be shown when a setting is \"\n            \"changed, but the embedding is not recomputed\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, Table(\"housing\"))\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The information message was not cleared on new data\"\n        )\n        # Flip; the info message should now be shown again.\n        self.widget.controls.multiscale.setChecked(False)\n        assert self.widget.Information.modified.is_shown()  # sanity check\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The information message was not cleared on no data\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden after the widget \"\n            \"computes the embedding\"\n        )\n\n    def test_invalidation_flow(self):\n        # pylint: disable=protected-access\n        w = self.widget\n        # Setup widget: send data to input with global structure \"off\", then\n        # set global structure \"on\" (after the embedding is computed)\n        w.controls.multiscale.setChecked(False)\n        self.send_signal(w.Inputs.data, self.data)\n        self.wait_until_finished()\n        self.assertFalse(self.widget.Information.modified.is_shown())\n        # All the embedding components should be computed\n        self.assertIsNotNone(w.normalized_data)\n        self.assertIsNotNone(w.pca_projection)\n        self.assertIsNotNone(w.affinities)\n        self.assertIsNotNone(w.tsne_embedding)\n        # All the invalidation flags should be set to false\n        self.assertFalse(w._invalidated.normalized_data)\n        self.assertFalse(w._invalidated.pca_projection)\n        self.assertFalse(w._invalidated.affinities)\n        self.assertFalse(w._invalidated.tsne_embedding)\n\n        # Trigger invalidation\n        w.controls.multiscale.setChecked(True)\n        self.assertTrue(self.widget.Information.modified.is_shown())\n        # Setting `multiscale` to true should set the invalidate flags for\n        # the affinities and embedding, but not the pca_projection\n        self.assertFalse(w._invalidated.normalized_data)\n        self.assertFalse(w._invalidated.pca_projection)\n        self.assertTrue(w._invalidated.affinities)\n        self.assertTrue(w._invalidated.tsne_embedding)\n\n        # The flags should now be set, but the embedding should still be\n        # available when selecting a subset of data and such\n        self.assertIsNotNone(w.normalized_data)\n        self.assertIsNotNone(w.pca_projection)\n        self.assertIsNotNone(w.affinities)\n        self.assertIsNotNone(w.tsne_embedding)\n\n        # We should still be able to send a data subset to the input and have\n        # the points be highlighted\n        self.send_signal(w.Inputs.data_subset, self.data[:10])\n        self.wait_until_stop_blocking()\n        subset = [brush.color().name() == \"#46befa\" for brush in\n                  w.graph.scatterplot_item.data[\"brush\"][:10]]\n        other = [brush.color().name() == \"#000000\" for brush in\n                 w.graph.scatterplot_item.data[\"brush\"][10:]]\n        self.assertTrue(all(subset))\n        self.assertTrue(all(other))\n\n        # Clear the data subset\n        self.send_signal(w.Inputs.data_subset, None)\n\n        # Run the optimization\n        self.widget.run_button.clicked.emit()\n        self.wait_until_stop_blocking()\n        # All of the inavalidation flags should have been cleared\n        self.assertFalse(w._invalidated)\n\n    def test_pca_preprocessing_warning_with_large_number_of_features(self):\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden by default\"\n        )\n\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden even after toggling options if \"\n            \"no data is on input\"\n        )\n\n        # Setup data classes\n        x_small = np.random.normal(0, 1, size=(50, 4))\n        data_small = Table.from_numpy(Domain.from_numpy(x_small), x_small)\n        x_large = np.random.normal(0, 1, size=(50, 250))\n        data_large = Table.from_numpy(Domain.from_numpy(x_large), x_large)\n\n        # SMALL data with PCA preprocessing ENABLED\n        self.send_signal(self.widget.Inputs.data, data_small)\n        self.widget.controls.use_pca_preprocessing.setChecked(True)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden when PCA preprocessing enabled \"\n            \"when the data has <50 features\"\n        )\n\n        # SMALL data with PCA preprocessing DISABLED\n        self.send_signal(self.widget.Inputs.data, data_small)\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden with disabled PCA preprocessing \"\n            \"when the data has <50 features\"\n        )\n\n        # LARGE data with PCA preprocessing ENABLED\n        self.send_signal(self.widget.Inputs.data, data_large)\n        self.widget.controls.use_pca_preprocessing.setChecked(True)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden when PCA preprocessing enabled \"\n            \"when has >50 features\"\n        )\n\n        # LARGE data with PCA preprocessing DISABLED\n        self.send_signal(self.widget.Inputs.data, data_large)\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertTrue(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be shown when PCA preprocessing disabled \"\n            \"when the data has >50 features\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The PCA warning should be cleared when problematic data is removed\"\n        )",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 29,
                                "end_lineno": 428,
                                "parent": null
                            }
                        }
                    ],
                    "deleted_entities": []
                }
            ]
        }
    ],
    "old_commit_hash": "659130d3cb87fa9aec1eddbb5636b2c646fc1542^",
    "new_commit_hash": "659130d3cb87fa9aec1eddbb5636b2c646fc1542",
    "commit_message": "owtsne: Warn if PCA disabled and large number of features",
    "commit_date": "2023-09-22T14:35:02+02:00",
    "metadata": {}
}
{
    "repo_name": "orange3",
    "new_commit_hash": "659130d3cb87fa9aec1eddbb5636b2c646fc1542",
    "test_file_codes": [
        "import unittest\nfrom unittest.mock import patch, Mock, call\n\nimport numpy as np\n\nfrom Orange.data import DiscreteVariable, ContinuousVariable, Domain, Table\nfrom Orange.preprocess import Normalize\nfrom Orange.projection import manifold, TSNE\nfrom Orange.projection.manifold import TSNEModel\nfrom Orange.widgets.tests.base import (\n    WidgetTest, WidgetOutputsTestMixin, ProjectionWidgetTestMixin\n)\nfrom Orange.widgets.unsupervised.owtsne import OWtSNE, TSNERunner, Task, prepare_tsne_obj\n\n\nclass DummyTSNE(manifold.TSNE):\n    def fit(self, X, Y=None):\n        return np.ones((len(X), 2), float)\n\n\nclass DummyTSNEModel(manifold.TSNEModel):\n    def transform(self, X, **kwargs):\n        return np.ones((len(X), 2), float)\n\n    def optimize(self, n_iter, **kwargs):\n        return self\n\n\nclass TestOWtSNE(WidgetTest, ProjectionWidgetTestMixin, WidgetOutputsTestMixin):\n    @classmethod\n    def setUpClass(cls):\n        super().setUpClass()\n        WidgetOutputsTestMixin.init(cls)\n        cls.same_input_output_domain = False\n\n        cls.signal_name = OWtSNE.Inputs.data\n        cls.signal_data = cls.data\n\n    def setUp(self):\n        # For almost all the tests, we won't need to verify t-SNE validity and\n        # the tests will run much faster if we dummy them out\n        self.tsne = patch(\"Orange.projection.manifold.TSNE\", new=DummyTSNE)\n        self.tsne_model = patch(\"Orange.projection.manifold.TSNEModel\", new=DummyTSNEModel)\n        self.tsne.start()\n        self.tsne_model.start()\n\n        self.widget = self.create_widget(OWtSNE, stored_settings={\"multiscale\": False})\n\n        self.class_var = DiscreteVariable(\"Stage name\", values=(\"STG1\", \"STG2\"))\n        self.attributes = [ContinuousVariable(\"GeneName\" + str(i)) for i in range(5)]\n        self.domain = Domain(self.attributes, class_vars=self.class_var)\n        self.empty_domain = Domain([], class_vars=self.class_var)\n\n    def tearDown(self):\n        # Some tests may not wait for the widget to finish, and the patched\n        # methods might be unpatched before the widget finishes, resulting in\n        # a very confusing crash.\n        self.widget.onDeleteWidget()\n        try:\n            self.restore_mocked_functions()\n        # If `restore_mocked_functions` was called in the test itself, stopping\n        # the patchers here will raise a RuntimeError\n        except RuntimeError as e:\n            if str(e) != \"stop called on unstarted patcher\":\n                raise e\n\n    def restore_mocked_functions(self):\n        self.tsne.stop()\n        self.tsne_model.stop()\n\n    def test_wrong_input(self):\n        # no data\n        data = None\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n\n        # <2 rows\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_rows.is_shown())\n\n        # no attributes\n        data = Table.from_list(self.empty_domain, [['STG1']] * 2)\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_cols.is_shown())\n\n        # one attributes\n        data = Table.from_list(self.empty_domain, [[1, 'STG1'],\n                                                   [2, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.not_enough_cols.is_shown())\n\n        # constant data\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1']] * 2)\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNone(self.widget.data)\n        self.assertTrue(self.widget.Error.constant_data.is_shown())\n\n        # correct input\n        data = Table.from_list(self.domain, [[1, 2, 3, 4, 5, 'STG1'],\n                                             [5, 4, 3, 2, 1, 'STG1']])\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n        self.assertIsNotNone(self.widget.data)\n        self.assertFalse(self.widget.Error.not_enough_rows.is_shown())\n        self.assertFalse(self.widget.Error.not_enough_cols.is_shown())\n        self.assertFalse(self.widget.Error.constant_data.is_shown())\n\n    def test_input(self):\n        data = Table.from_list(self.domain, [[1, 1, 1, 1, 1, 'STG1'],\n                                             [2, 2, 2, 2, 2, 'STG1'],\n                                             [4, 4, 4, 4, 4, 'STG2'],\n                                             [5, 5, 5, 5, 5, 'STG2']])\n\n        self.send_signal(self.widget.Inputs.data, data)\n        self.wait_until_stop_blocking()\n\n    def test_attr_models(self):\n        \"\"\"Check possible values for 'Color', 'Shape', 'Size' and 'Label'\"\"\"\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        controls = self.widget.controls\n        for var in self.data.domain.class_vars + self.data.domain.metas:\n            self.assertIn(var, controls.attr_color.model())\n            self.assertIn(var, controls.attr_label.model())\n            if var.is_continuous:\n                self.assertIn(var, controls.attr_size.model())\n                self.assertNotIn(var, controls.attr_shape.model())\n            if var.is_discrete:\n                self.assertNotIn(var, controls.attr_size.model())\n                self.assertIn(var, controls.attr_shape.model())\n\n    def test_multiscale_changed_updates_ui(self):\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.assertFalse(self.widget.controls.multiscale.isChecked())\n        self.assertTrue(self.widget.perplexity_spin.isEnabled())\n        self.widget.controls.multiscale.setChecked(True)\n        self.assertFalse(self.widget.perplexity_spin.isEnabled())\n\n        settings = self.widget.settingsHandler.pack_data(self.widget)\n        w = self.create_widget(OWtSNE, stored_settings=settings)\n        self.send_signal(w.Inputs.data, self.data, widget=w)\n        self.assertTrue(w.controls.multiscale.isChecked())\n        self.assertFalse(w.perplexity_spin.isEnabled())\n        w.onDeleteWidget()\n\n    def test_normalize_data(self):\n        # Normalization should be checked by default\n        self.assertTrue(self.widget.controls.normalize.isChecked())\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_called_once()\n\n        # Disable checkbox\n        self.widget.controls.normalize.setChecked(False)\n        self.assertFalse(self.widget.controls.normalize.isChecked())\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, self.data)\n            self.assertTrue(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_not_called()\n\n        # Normalization shouldn't work on sparse data\n        self.widget.controls.normalize.setChecked(True)\n        self.assertTrue(self.widget.controls.normalize.isChecked())\n\n        sparse_data = self.data.to_sparse()\n        with patch(\"Orange.preprocess.preprocess.Normalize\", wraps=Normalize) as normalize:\n            self.send_signal(self.widget.Inputs.data, sparse_data)\n            self.assertFalse(self.widget.controls.normalize.isEnabled())\n            self.wait_until_finished()\n            normalize.assert_not_called()\n\n    @patch(\"Orange.projection.manifold.TSNEModel.optimize\")\n    def test_exaggeration_is_passed_through_properly(self, optimize):\n        def _check_exaggeration(call, exaggeration):\n            # Check the last call to `optimize`, so we catch one during the\n            # regular regime\n            _, _, kwargs = call.mock_calls[-1]\n            self.assertIn(\"exaggeration\", kwargs)\n            self.assertEqual(kwargs[\"exaggeration\"], exaggeration)\n\n        # Since optimize needs to return a valid TSNEModel instance and it is\n        # impossible to return `self` in a mock, we'll prepare this one ahead\n        # of time and use this\n        optimize.return_value = DummyTSNE()(self.data)\n\n        # Set value to 1\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.run_button.clicked.emit()  # stop initial run\n        self.wait_until_stop_blocking()\n        self.widget.controls.exaggeration.setValue(1)\n        self.widget.run_button.clicked.emit()  # run with exaggeration 1\n        self.wait_until_finished()\n        _check_exaggeration(optimize, 1)\n\n        # Reset and clear state\n        self.send_signal(self.widget.Inputs.data, None)\n        optimize.reset_mock()\n\n        # Change to 3\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.widget.run_button.clicked.emit()  # stop initial run\n        self.wait_until_stop_blocking()\n        self.widget.controls.exaggeration.setValue(3)\n        self.widget.run_button.clicked.emit()  # run with exaggeration 1\n        self.wait_until_finished()\n        _check_exaggeration(optimize, 3)\n\n    def test_plot_once(self):\n        \"\"\"Test if data is plotted only once but committed on every input change\"\"\"\n        self.widget.setup_plot = Mock()\n        self.widget.commit.deferred = self.widget.commit.now = Mock()\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        # TODO: The base widget immediately calls `setup_plot` and `commit`\n        # even though there's nothing to show yet. Unfortunately, fixing this\n        # would require changing `OWDataProjectionWidget` in some strange way,\n        # so as a temporary fix, we reset the mocks, so they reflect the calls\n        # when the result was available.\n        self.widget.setup_plot.reset_mock()\n        self.widget.commit.deferred.reset_mock()\n        self.wait_until_finished()\n\n        self.widget.setup_plot.assert_called_once()\n        self.widget.commit.deferred.assert_called_once()\n\n        self.widget.commit.deferred.reset_mock()\n        self.send_signal(self.widget.Inputs.data_subset, self.data[::10])\n        self.wait_until_stop_blocking()\n\n        self.widget.setup_plot.assert_called_once()\n        self.widget.commit.deferred.assert_called_once()\n\n    def test_modified_info_message_behaviour(self):\n        \"\"\"Information messages should be cleared if the data changes or if\n        the data is set to None.\"\"\"\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden by default\"\n        )\n\n        self.widget.controls.multiscale.setChecked(False)\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden even after toggling \"\n            \"options if no data is on input\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden after the widget \"\n            \"computes the embedding\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden when reloading the \"\n            \"same data set and no previous messages were shown\"\n        )\n\n        self.widget.controls.multiscale.setChecked(True)\n        self.assertTrue(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be shown when a setting is \"\n            \"changed, but the embedding is not recomputed\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, Table(\"housing\"))\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The information message was not cleared on new data\"\n        )\n        # Flip; the info message should now be shown again.\n        self.widget.controls.multiscale.setChecked(False)\n        assert self.widget.Information.modified.is_shown()  # sanity check\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The information message was not cleared on no data\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, self.data)\n        self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The modified info message should be hidden after the widget \"\n            \"computes the embedding\"\n        )\n\n    def test_invalidation_flow(self):\n        # pylint: disable=protected-access\n        w = self.widget\n        # Setup widget: send data to input with global structure \"off\", then\n        # set global structure \"on\" (after the embedding is computed)\n        w.controls.multiscale.setChecked(False)\n        self.send_signal(w.Inputs.data, self.data)\n        self.wait_until_finished()\n        self.assertFalse(self.widget.Information.modified.is_shown())\n        # All the embedding components should be computed\n        self.assertIsNotNone(w.normalized_data)\n        self.assertIsNotNone(w.pca_projection)\n        self.assertIsNotNone(w.affinities)\n        self.assertIsNotNone(w.tsne_embedding)\n        # All the invalidation flags should be set to false\n        self.assertFalse(w._invalidated.normalized_data)\n        self.assertFalse(w._invalidated.pca_projection)\n        self.assertFalse(w._invalidated.affinities)\n        self.assertFalse(w._invalidated.tsne_embedding)\n\n        # Trigger invalidation\n        w.controls.multiscale.setChecked(True)\n        self.assertTrue(self.widget.Information.modified.is_shown())\n        # Setting `multiscale` to true should set the invalidate flags for\n        # the affinities and embedding, but not the pca_projection\n        self.assertFalse(w._invalidated.normalized_data)\n        self.assertFalse(w._invalidated.pca_projection)\n        self.assertTrue(w._invalidated.affinities)\n        self.assertTrue(w._invalidated.tsne_embedding)\n\n        # The flags should now be set, but the embedding should still be\n        # available when selecting a subset of data and such\n        self.assertIsNotNone(w.normalized_data)\n        self.assertIsNotNone(w.pca_projection)\n        self.assertIsNotNone(w.affinities)\n        self.assertIsNotNone(w.tsne_embedding)\n\n        # We should still be able to send a data subset to the input and have\n        # the points be highlighted\n        self.send_signal(w.Inputs.data_subset, self.data[:10])\n        self.wait_until_stop_blocking()\n        subset = [brush.color().name() == \"#46befa\" for brush in\n                  w.graph.scatterplot_item.data[\"brush\"][:10]]\n        other = [brush.color().name() == \"#000000\" for brush in\n                 w.graph.scatterplot_item.data[\"brush\"][10:]]\n        self.assertTrue(all(subset))\n        self.assertTrue(all(other))\n\n        # Clear the data subset\n        self.send_signal(w.Inputs.data_subset, None)\n\n        # Run the optimization\n        self.widget.run_button.clicked.emit()\n        self.wait_until_stop_blocking()\n        # All of the inavalidation flags should have been cleared\n        self.assertFalse(w._invalidated)\n\n    def test_pca_preprocessing_warning_with_large_number_of_features(self):\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden by default\"\n        )\n\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden even after toggling options if \"\n            \"no data is on input\"\n        )\n\n        # Setup data classes\n        x_small = np.random.normal(0, 1, size=(50, 4))\n        data_small = Table.from_numpy(Domain.from_numpy(x_small), x_small)\n        x_large = np.random.normal(0, 1, size=(50, 250))\n        data_large = Table.from_numpy(Domain.from_numpy(x_large), x_large)\n\n        # SMALL data with PCA preprocessing ENABLED\n        self.send_signal(self.widget.Inputs.data, data_small)\n        self.widget.controls.use_pca_preprocessing.setChecked(True)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden when PCA preprocessing enabled \"\n            \"when the data has <50 features\"\n        )\n\n        # SMALL data with PCA preprocessing DISABLED\n        self.send_signal(self.widget.Inputs.data, data_small)\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden with disabled PCA preprocessing \"\n            \"when the data has <50 features\"\n        )\n\n        # LARGE data with PCA preprocessing ENABLED\n        self.send_signal(self.widget.Inputs.data, data_large)\n        self.widget.controls.use_pca_preprocessing.setChecked(True)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertFalse(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden when PCA preprocessing enabled \"\n            \"when has >50 features\"\n        )\n\n        # LARGE data with PCA preprocessing DISABLED\n        self.send_signal(self.widget.Inputs.data, data_large)\n        self.widget.controls.use_pca_preprocessing.setChecked(False)\n        self.widget.run_button.click(), self.wait_until_stop_blocking()\n        self.assertTrue(\n            self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be shown when PCA preprocessing disabled \"\n            \"when the data has >50 features\"\n        )\n\n        self.send_signal(self.widget.Inputs.data, None)\n        self.assertFalse(\n            self.widget.Information.modified.is_shown(),\n            \"The PCA warning should be cleared when problematic data is removed\"\n        )\n\n\nclass TestTSNERunner(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.data = Table(\"iris\")\n\n    def test_run_with_normalization_and_pca_preprocessing(self):\n        state = Mock()\n        state.is_interruption_requested = Mock(return_value=False)\n\n        task = Task(\n            normalize=True, use_pca_preprocessing=True, data=self.data, perplexity=30\n        )\n        task = TSNERunner.run(task, state)\n\n        self.assertEqual(len(state.set_status.mock_calls), 5)\n        state.set_status.assert_has_calls([\n            call(\"Normalizing data...\"),\n            call(\"Computing PCA...\"),\n            call(\"Preparing initialization...\"),\n            call(\"Finding nearest neighbors...\"),\n            call(\"Running optimization...\"),\n        ])\n\n        self.assertIsInstance(task.normalized_data, Table)\n        self.assertIsInstance(task.pca_projection, Table)\n        self.assertIsInstance(task.tsne, TSNE)\n        self.assertIsInstance(task.tsne_embedding, TSNEModel)\n\n    def test_run_with_normalization(self):\n        state = Mock()\n        state.is_interruption_requested = Mock(return_value=False)\n\n        task = Task(\n            normalize=True, use_pca_preprocessing=False, data=self.data, perplexity=30\n        )\n        task = TSNERunner.run(task, state)\n\n        self.assertEqual(len(state.set_status.mock_calls), 4)\n        state.set_status.assert_has_calls([\n            call(\"Normalizing data...\"),\n            call(\"Preparing initialization...\"),\n            call(\"Finding nearest neighbors...\"),\n            call(\"Running optimization...\"),\n        ])\n\n        self.assertIsNone(task.pca_projection, Table)\n\n        self.assertIsInstance(task.normalized_data, Table)\n        self.assertIsInstance(task.tsne, TSNE)\n        self.assertIsInstance(task.tsne_embedding, TSNEModel)\n\n    def test_run_with_pca_preprocessing(self):\n        state = Mock()\n        state.is_interruption_requested = Mock(return_value=False)\n\n        task = Task(\n            normalize=False, use_pca_preprocessing=True, data=self.data, perplexity=30\n        )\n        task = TSNERunner.run(task, state)\n\n        self.assertEqual(len(state.set_status.mock_calls), 4)\n        state.set_status.assert_has_calls([\n            call(\"Computing PCA...\"),\n            call(\"Preparing initialization...\"),\n            call(\"Finding nearest neighbors...\"),\n            call(\"Running optimization...\"),\n        ])\n        state.set_status.assert_has_calls\n\n        self.assertIsNone(task.normalized_data, Table)\n\n        self.assertIsInstance(task.pca_projection, Table)\n        self.assertIsInstance(task.tsne, TSNE)\n        self.assertIsInstance(task.tsne_embedding, TSNEModel)\n\n    def test_run_do_not_modify_model_inplace(self):\n        state = Mock()\n        state.is_interruption_requested.return_value = True\n\n        task = Task(data=self.data, perplexity=30, multiscale=False, exaggeration=1)\n        # Run through all the steps to prepare the t-SNE object\n        task.tsne = prepare_tsne_obj(\n            task.data, task.perplexity, task.multiscale, task.exaggeration\n        )\n        TSNERunner.compute_normalization(task, state)\n        TSNERunner.compute_pca(task, state)\n        TSNERunner.compute_initialization(task, state)\n        TSNERunner.compute_affinities(task, state)\n        # Run the t-SNE iteration once to create the object\n        TSNERunner.compute_tsne(task, state)\n\n        # Make sure that running t-SNE for another iteration returns a new object\n        tsne_obj_before = task.tsne_embedding\n        state.reset_mock()\n        TSNERunner.compute_tsne(task, state)\n        tsne_obj_after = task.tsne_embedding\n\n        state.set_partial_result.assert_called_once()\n        self.assertIsNot(tsne_obj_before, tsne_obj_after)\n\n\nif __name__ == \"__main__\":\n    unittest.main()\n"
    ],
    "test_file_names": [
        "test_1.py"
    ],
    "setup_res_code": 0,
    "setup_res_stdout": "Starting Orange installation attempts...\nAttempting installation with Python 3.7...\nCompiling Orange/classification/_tree_scorers.pyx because it changed.\nCompiling Orange/data/_contingency.pyx because it changed.\nCompiling Orange/data/_io.pyx because it changed.\nCompiling Orange/data/_valuecount.pyx because it changed.\nCompiling Orange/data/_variable.pyx because it changed.\nCompiling Orange/distance/_distance.pyx because it changed.\nCompiling Orange/preprocess/_discretize.pyx because it changed.\nCompiling Orange/preprocess/_relieff.pyx because it changed.\nCompiling Orange/projection/_som.pyx because it changed.\n[1/9] Cythonizing Orange/classification/_tree_scorers.pyx\n[2/9] Cythonizing Orange/data/_contingency.pyx\n[3/9] Cythonizing Orange/data/_io.pyx\n[4/9] Cythonizing Orange/data/_valuecount.pyx\n[5/9] Cythonizing Orange/data/_variable.pyx\n[6/9] Cythonizing Orange/distance/_distance.pyx\n[7/9] Cythonizing Orange/preprocess/_discretize.pyx\n[8/9] Cythonizing Orange/preprocess/_relieff.pyx\n[9/9] Cythonizing Orange/projection/_som.pyx\nrunning build_ext\nbuilding 'Orange.classification._simple_tree' extension\ncreating build\ncreating build/temp.linux-x86_64-3.7\ncreating build/temp.linux-x86_64-3.7/Orange\ncreating build/temp.linux-x86_64-3.7/Orange/classification\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/classification/_simple_tree.c -o build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o\ncreating build/lib.linux-x86_64-3.7\ncreating build/lib.linux-x86_64-3.7/Orange\ncreating build/lib.linux-x86_64-3.7/Orange/classification\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_simple_tree.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.widgets.utils._grid_density' extension\ncreating build/temp.linux-x86_64-3.7/Orange/widgets\ncreating build/temp.linux-x86_64-3.7/Orange/widgets/utils\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/widgets/utils/_grid_density.cpp -o build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o\ncreating build/lib.linux-x86_64-3.7/Orange/widgets\ncreating build/lib.linux-x86_64-3.7/Orange/widgets/utils\nc++ -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.classification._tree_scorers' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/classification/_tree_scorers.c -o build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/classification/_tree_scorers.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._contingency' extension\ncreating build/temp.linux-x86_64-3.7/Orange/data\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_contingency.c -o build/temp.linux-x86_64-3.7/Orange/data/_contingency.o\ncreating build/lib.linux-x86_64-3.7/Orange/data\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_contingency.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._io' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_io.c -o build/temp.linux-x86_64-3.7/Orange/data/_io.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_io.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._valuecount' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_valuecount.c -o build/temp.linux-x86_64-3.7/Orange/data/_valuecount.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_valuecount.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.data._variable' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/data/_variable.c -o build/temp.linux-x86_64-3.7/Orange/data/_variable.o\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/data/_variable.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.distance._distance' extension\ncreating build/temp.linux-x86_64-3.7/Orange/distance\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/distance/_distance.c -o build/temp.linux-x86_64-3.7/Orange/distance/_distance.o\ncreating build/lib.linux-x86_64-3.7/Orange/distance\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/distance/_distance.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._discretize' extension\ncreating build/temp.linux-x86_64-3.7/Orange/preprocess\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/preprocess/_discretize.c -o build/temp.linux-x86_64-3.7/Orange/preprocess/_discretize.o\ncreating build/lib.linux-x86_64-3.7/Orange/preprocess\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/preprocess/_discretize.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._relieff' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/preprocess/_relieff.cpp -o build/temp.linux-x86_64-3.7/Orange/preprocess/_relieff.o\nc++ -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/preprocess/_relieff.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so\nbuilding 'Orange.projection._som' extension\ncreating build/temp.linux-x86_64-3.7/Orange/projection\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/tools/deps/include -I/tools/deps/include/ncursesw -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/include/python3.7m -c Orange/projection/_som.c -o build/temp.linux-x86_64-3.7/Orange/projection/_som.o\ncreating build/lib.linux-x86_64-3.7/Orange/projection\ncc -pthread -shared -L/tools/deps/lib build/temp.linux-x86_64-3.7/Orange/projection/_som.o -L/home/gcpuser/.local/share/uv/python/cpython-3.7.9-linux-x86_64-gnu/lib -lm -lpython3.7m -o build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so -> Orange/widgets/utils\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so -> Orange/projection\nrunning develop\nrunning egg_info\ncreating Orange3.egg-info\nwriting Orange3.egg-info/PKG-INFO\nwriting dependency_links to Orange3.egg-info/dependency_links.txt\nwriting entry points to Orange3.egg-info/entry_points.txt\nwriting requirements to Orange3.egg-info/requires.txt\nwriting top-level names to Orange3.egg-info/top_level.txt\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest template 'MANIFEST.in'\nadding license file 'LICENSE'\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nrunning build_ext\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_simple_tree.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/widgets/utils/_grid_density.cpython-37m-x86_64-linux-gnu.so -> Orange/widgets/utils\ncopying build/lib.linux-x86_64-3.7/Orange/classification/_tree_scorers.cpython-37m-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-3.7/Orange/data/_contingency.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_io.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_valuecount.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/data/_variable.cpython-37m-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-3.7/Orange/distance/_distance.cpython-37m-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_discretize.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/preprocess/_relieff.cpython-37m-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-3.7/Orange/projection/_som.cpython-37m-x86_64-linux-gnu.so -> Orange/projection\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.37.0.dev0+659130d to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542\nProcessing dependencies for Orange3==3.37.0.dev0+659130d\nSearching for xlsxwriter\nReading https://pypi.org/simple/xlsxwriter/\nDownloading https://files.pythonhosted.org/packages/a7/ea/53d1fe468e63e092cf16e2c18d16f50c29851242f9dd12d6a66e0d7f0d02/XlsxWriter-3.2.0-py3-none-any.whl#sha256=ecfd5405b3e0e228219bcaf24c2ca0915e012ca9464a14048021d21a995d490e\nBest match: XlsxWriter 3.2.0\nProcessing XlsxWriter-3.2.0-py3-none-any.whl\nInstalling XlsxWriter-3.2.0-py3-none-any.whl to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages\nAdding XlsxWriter 3.2.0 to easy-install.pth file\nInstalling vba_extract.py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/XlsxWriter-3.2.0-py3.7.egg\nSearching for xlrd>=1.2.0\nReading https://pypi.org/simple/xlrd/\nDownloading https://files.pythonhosted.org/packages/a6/0c/c2a72d51fe56e08a08acc85d13013558a2d793028ae7385448a6ccdfae64/xlrd-2.0.1-py2.py3-none-any.whl#sha256=6a33ee89877bd9abc1158129f6e94be74e2679636b8a205b43b85206c3f0bbdd\nBest match: xlrd 2.0.1\nProcessing xlrd-2.0.1-py2.py3-none-any.whl\nInstalling xlrd-2.0.1-py2.py3-none-any.whl to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages\nAdding xlrd 2.0.1 to easy-install.pth file\nInstalling runxlrd.py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/xlrd-2.0.1-py3.7.egg\nSearching for xgboost>=1.7.4\nReading https://pypi.org/simple/xgboost/\nDownloading https://files.pythonhosted.org/packages/48/bc/05d7db90d421c5e3d681a12fd1eb087e37bf2e9bbe2b105422d6319ecc92/xgboost-2.1.3-py3-none-manylinux2014_x86_64.whl#sha256=32a43526208fe676527c698cb852e0e9515e6d7294143780e476d335290a131b\nBest match: xgboost 2.1.3\nProcessing xgboost-2.1.3-py3-none-manylinux2014_x86_64.whl\nInstalling xgboost-2.1.3-py3-none-manylinux2014_x86_64.whl to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages\nAdding xgboost 2.1.3 to easy-install.pth file\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/xgboost-2.1.3-py3.7-linux-x86_64.egg\nSearching for serverfiles\nReading https://pypi.org/simple/serverfiles/\nDownloading https://files.pythonhosted.org/packages/33/36/794fe1c4ed29b0f56a26d72e956baf0285d8fe9e29faf36797a28a8ad45b/serverfiles-0.3.1.tar.gz#sha256=5e10fc32e758791e3735bc08bce2ed4702a83b1e45ab96c5d59cc8aeecfbebe1\nBest match: serverfiles 0.3.1\nProcessing serverfiles-0.3.1.tar.gz\nWriting /tmp/easy_install-_370a01b/serverfiles-0.3.1/setup.cfg\nRunning serverfiles-0.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_370a01b/serverfiles-0.3.1/egg-dist-tmp-7wochfj0\ncreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/serverfiles-0.3.1-py3.7.egg\nExtracting serverfiles-0.3.1-py3.7.egg to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages\nAdding serverfiles 0.3.1 to easy-install.pth file\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/serverfiles-0.3.1-py3.7.egg\nSearching for scipy>=1.9\nReading https://pypi.org/simple/scipy/\nDownloading https://files.pythonhosted.org/packages/d9/7b/2b8ac283cf32465ed08bc20a83d559fe7b174a484781702ba8accea001d6/scipy-1.15.0.tar.gz#sha256=300742e2cc94e36a2880ebe464a1c8b4352a7b0f3e36ec3d2ac006cdbe0219ac\nBest match: scipy 1.15.0\nProcessing scipy-1.15.0.tar.gz\nVerifying Orange installation...\n❌ Orange verification failed\nPython 3.7 installation failed, trying Python 3.8...\nAttempting installation with Python 3.8...\nrunning build_ext\nbuilding 'Orange.classification._simple_tree' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/classification\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/classification/_simple_tree.c -o build/temp.linux-x86_64-cpython-38/Orange/classification/_simple_tree.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/classification\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/classification/_simple_tree.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/classification/_simple_tree.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.widgets.utils._grid_density' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/widgets/utils\nc++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/widgets/utils/_grid_density.cpp -o build/temp.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/widgets/utils\nc++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -pthread -shared build/temp.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.classification._tree_scorers' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/classification/_tree_scorers.c -o build/temp.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.o\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.data._contingency' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/data\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/data/_contingency.c -o build/temp.linux-x86_64-cpython-38/Orange/data/_contingency.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/data\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/data/_contingency.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/data/_contingency.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.data._io' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/data/_io.c -o build/temp.linux-x86_64-cpython-38/Orange/data/_io.o\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/data/_io.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/data/_io.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.data._valuecount' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/data/_valuecount.c -o build/temp.linux-x86_64-cpython-38/Orange/data/_valuecount.o\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/data/_valuecount.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/data/_valuecount.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.data._variable' extension\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/data/_variable.c -o build/temp.linux-x86_64-cpython-38/Orange/data/_variable.o\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/data/_variable.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/data/_variable.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.distance._distance' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/distance\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/distance/_distance.c -o build/temp.linux-x86_64-cpython-38/Orange/distance/_distance.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/distance\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/distance/_distance.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/distance/_distance.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._discretize' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/preprocess\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/preprocess/_discretize.c -o build/temp.linux-x86_64-cpython-38/Orange/preprocess/_discretize.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/preprocess\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/preprocess/_discretize.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/preprocess/_discretize.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.preprocess._relieff' extension\nc++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/preprocess/_relieff.cpp -o build/temp.linux-x86_64-cpython-38/Orange/preprocess/_relieff.o\nc++ -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -pthread -shared build/temp.linux-x86_64-cpython-38/Orange/preprocess/_relieff.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/preprocess/_relieff.cpython-38-x86_64-linux-gnu.so\nbuilding 'Orange.projection._som' extension\ncreating build/temp.linux-x86_64-cpython-38/Orange/projection\ncc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -fPIC -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include -I/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/include -I/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/include/python3.8 -c Orange/projection/_som.c -o build/temp.linux-x86_64-cpython-38/Orange/projection/_som.o\ncreating build/lib.linux-x86_64-cpython-38/Orange/projection\ncc -pthread -shared -Wl,--exclude-libs,ALL build/temp.linux-x86_64-cpython-38/Orange/projection/_som.o -L/home/gcpuser/.local/share/uv/python/cpython-3.8.20-linux-x86_64-gnu/lib -lm -o build/lib.linux-x86_64-cpython-38/Orange/projection/_som.cpython-38-x86_64-linux-gnu.so\ncopying build/lib.linux-x86_64-cpython-38/Orange/classification/_simple_tree.cpython-38-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.cpython-38-x86_64-linux-gnu.so -> Orange/widgets/utils\ncopying build/lib.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.cpython-38-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_contingency.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_io.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_valuecount.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_variable.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/distance/_distance.cpython-38-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-cpython-38/Orange/preprocess/_discretize.cpython-38-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-cpython-38/Orange/preprocess/_relieff.cpython-38-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-cpython-38/Orange/projection/_som.cpython-38-x86_64-linux-gnu.so -> Orange/projection\nrunning develop\nrunning egg_info\nwriting Orange3.egg-info/PKG-INFO\nwriting dependency_links to Orange3.egg-info/dependency_links.txt\nwriting entry points to Orange3.egg-info/entry_points.txt\nwriting requirements to Orange3.egg-info/requires.txt\nwriting top-level names to Orange3.egg-info/top_level.txt\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayscalars.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_math.h won't be automatically included in the manifest: the path must be relative\ndependency /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ufuncobject.h won't be automatically included in the manifest: the path must be relative\nreading manifest file 'Orange3.egg-info/SOURCES.txt'\nreading manifest template 'MANIFEST.in'\nadding license file 'LICENSE'\nwriting manifest file 'Orange3.egg-info/SOURCES.txt'\nrunning build_ext\ncopying build/lib.linux-x86_64-cpython-38/Orange/classification/_simple_tree.cpython-38-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-cpython-38/Orange/widgets/utils/_grid_density.cpython-38-x86_64-linux-gnu.so -> Orange/widgets/utils\ncopying build/lib.linux-x86_64-cpython-38/Orange/classification/_tree_scorers.cpython-38-x86_64-linux-gnu.so -> Orange/classification\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_contingency.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_io.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_valuecount.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/data/_variable.cpython-38-x86_64-linux-gnu.so -> Orange/data\ncopying build/lib.linux-x86_64-cpython-38/Orange/distance/_distance.cpython-38-x86_64-linux-gnu.so -> Orange/distance\ncopying build/lib.linux-x86_64-cpython-38/Orange/preprocess/_discretize.cpython-38-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-cpython-38/Orange/preprocess/_relieff.cpython-38-x86_64-linux-gnu.so -> Orange/preprocess\ncopying build/lib.linux-x86_64-cpython-38/Orange/projection/_som.cpython-38-x86_64-linux-gnu.so -> Orange/projection\nCreating /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/Orange3.egg-link (link to .)\nAdding Orange3 3.37.0.dev0+659130d to easy-install.pth file\nInstalling orange-canvas script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\n\nInstalled /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542\nProcessing dependencies for Orange3==3.37.0.dev0+659130d\nSearching for XlsxWriter==3.2.0\nBest match: XlsxWriter 3.2.0\nAdding XlsxWriter 3.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for xlrd==2.0.1\nBest match: xlrd 2.0.1\nAdding xlrd 2.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for xgboost==2.1.3\nBest match: xgboost 2.1.3\nAdding xgboost 2.1.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for setuptools==75.3.0\nBest match: setuptools 75.3.0\nAdding setuptools 75.3.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for serverfiles==0.3.1\nBest match: serverfiles 0.3.1\nAdding serverfiles 0.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for scipy==1.10.1\nBest match: scipy 1.10.1\nAdding scipy 1.10.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for scikit-learn==1.1.3\nBest match: scikit-learn 1.1.3\nAdding scikit-learn 1.1.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for requests==2.32.3\nBest match: requests 2.32.3\nAdding requests 2.32.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for qtconsole==5.6.1\nBest match: qtconsole 5.6.1\nAdding qtconsole 5.6.1 to easy-install.pth file\nInstalling jupyter-qtconsole script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for PyYAML==6.0.2\nBest match: PyYAML 6.0.2\nAdding PyYAML 6.0.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for python-louvain==0.16\nBest match: python-louvain 0.16\nAdding python-louvain 0.16 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for pyqtgraph==0.13.3\nBest match: pyqtgraph 0.13.3\nAdding pyqtgraph 0.13.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for pygments==2.19.1\nBest match: pygments 2.19.1\nAdding pygments 2.19.1 to easy-install.pth file\nInstalling pygmentize script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for pip==24.3.1\nBest match: pip 24.3.1\nAdding pip 24.3.1 to easy-install.pth file\nInstalling pip script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\nInstalling pip3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for pandas==2.0.3\nBest match: pandas 2.0.3\nAdding pandas 2.0.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for orange-widget-base==4.22.0\nBest match: orange-widget-base 4.22.0\nAdding orange-widget-base 4.22.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for orange-canvas-core==0.1.35\nBest match: orange-canvas-core 0.1.35\nAdding orange-canvas-core 0.1.35 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for openpyxl==3.1.5\nBest match: openpyxl 3.1.5\nAdding openpyxl 3.1.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for openTSNE==1.0.1\nBest match: openTSNE 1.0.1\nAdding openTSNE 1.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for numpy==1.24.4\nBest match: numpy 1.24.4\nAdding numpy 1.24.4 to easy-install.pth file\nInstalling f2py script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\nInstalling f2py3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\nInstalling f2py3.8 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for networkx==3.1\nBest match: networkx 3.1\nAdding networkx 3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for matplotlib==3.7.5\nBest match: matplotlib 3.7.5\nAdding matplotlib 3.7.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for keyrings.alt==5.0.2\nBest match: keyrings.alt 5.0.2\nAdding keyrings.alt 5.0.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for keyring==25.5.0\nBest match: keyring 25.5.0\nAdding keyring 25.5.0 to easy-install.pth file\nInstalling keyring script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for joblib==1.4.2\nBest match: joblib 1.4.2\nAdding joblib 1.4.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for httpx==0.28.1\nBest match: httpx 0.28.1\nAdding httpx 0.28.1 to easy-install.pth file\nInstalling httpx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for chardet==5.2.0\nBest match: chardet 5.2.0\nAdding chardet 5.2.0 to easy-install.pth file\nInstalling chardetect script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for catboost==1.2.7\nBest match: catboost 1.2.7\nAdding catboost 1.2.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for Bottleneck==1.4.0\nBest match: Bottleneck 1.4.0\nAdding Bottleneck 1.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for baycomp==1.0.3\nBest match: baycomp 1.0.3\nAdding baycomp 1.0.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for AnyQt==0.2.0\nBest match: AnyQt 0.2.0\nAdding AnyQt 0.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for nvidia-nccl-cu12==2.24.3\nBest match: nvidia-nccl-cu12 2.24.3\nAdding nvidia-nccl-cu12 2.24.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for threadpoolctl==3.5.0\nBest match: threadpoolctl 3.5.0\nAdding threadpoolctl 3.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for certifi==2024.12.14\nBest match: certifi 2024.12.14\nAdding certifi 2024.12.14 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for urllib3==2.2.3\nBest match: urllib3 2.2.3\nAdding urllib3 2.2.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for idna==3.10\nBest match: idna 3.10\nAdding idna 3.10 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for charset-normalizer==3.4.1\nBest match: charset-normalizer 3.4.1\nAdding charset-normalizer 3.4.1 to easy-install.pth file\nInstalling normalizer script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for packaging==24.2\nBest match: packaging 24.2\nAdding packaging 24.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for QtPy==2.4.2\nBest match: QtPy 2.4.2\nAdding QtPy 2.4.2 to easy-install.pth file\nInstalling qtpy script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for ipykernel==6.29.5\nBest match: ipykernel 6.29.5\nAdding ipykernel 6.29.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for jupyter-client==8.6.3\nBest match: jupyter-client 8.6.3\nAdding jupyter-client 8.6.3 to easy-install.pth file\nInstalling jupyter-kernel script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\nInstalling jupyter-kernelspec script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\nInstalling jupyter-run script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for jupyter-core==5.7.2\nBest match: jupyter-core 5.7.2\nAdding jupyter-core 5.7.2 to easy-install.pth file\nInstalling jupyter script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\nInstalling jupyter-migrate script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\nInstalling jupyter-troubleshoot script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for traitlets==5.14.3\nBest match: traitlets 5.14.3\nAdding traitlets 5.14.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for tzdata==2024.2\nBest match: tzdata 2024.2\nAdding tzdata 2024.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for pytz==2024.2\nBest match: pytz 2024.2\nAdding pytz 2024.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for python-dateutil==2.9.0.post0\nBest match: python-dateutil 2.9.0.post0\nAdding python-dateutil 2.9.0.post0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for typing-extensions==4.12.2\nBest match: typing-extensions 4.12.2\nAdding typing-extensions 4.12.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/setuptools/_vendor\nSearching for qasync==0.27.1\nBest match: qasync 0.27.1\nAdding qasync 0.27.1 to easy-install.pth file\ndetected new path './setuptools/_vendor'\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for dictdiffer==0.9.0\nBest match: dictdiffer 0.9.0\nAdding dictdiffer 0.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for requests-cache==1.2.1\nBest match: requests-cache 1.2.1\nAdding requests-cache 1.2.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for commonmark==0.9.1\nBest match: commonmark 0.9.1\nAdding commonmark 0.9.1 to easy-install.pth file\nInstalling cmark script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for docutils==0.20.1\nBest match: docutils 0.20.1\nAdding docutils 0.20.1 to easy-install.pth file\nInstalling docutils script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for et-xmlfile==2.0.0\nBest match: et-xmlfile 2.0.0\nAdding et-xmlfile 2.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for importlib-resources==6.4.5\nBest match: importlib-resources 6.4.5\nAdding importlib-resources 6.4.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for pyparsing==3.1.4\nBest match: pyparsing 3.1.4\nAdding pyparsing 3.1.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for pillow==10.4.0\nBest match: pillow 10.4.0\nAdding pillow 10.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for kiwisolver==1.4.7\nBest match: kiwisolver 1.4.7\nAdding kiwisolver 1.4.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for fonttools==4.55.3\nBest match: fonttools 4.55.3\nAdding fonttools 4.55.3 to easy-install.pth file\nInstalling fonttools script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\nInstalling pyftmerge script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\nInstalling pyftsubset script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\nInstalling ttx script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for cycler==0.12.1\nBest match: cycler 0.12.1\nAdding cycler 0.12.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for contourpy==1.1.1\nBest match: contourpy 1.1.1\nAdding contourpy 1.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for jaraco.context==6.0.1\nBest match: jaraco.context 6.0.1\nAdding jaraco.context 6.0.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for jaraco.classes==3.4.0\nBest match: jaraco.classes 3.4.0\nAdding jaraco.classes 3.4.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for jeepney==0.8.0\nBest match: jeepney 0.8.0\nAdding jeepney 0.8.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for SecretStorage==3.3.3\nBest match: SecretStorage 3.3.3\nAdding SecretStorage 3.3.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for importlib-metadata==8.5.0\nBest match: importlib-metadata 8.5.0\nAdding importlib-metadata 8.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for jaraco.functools==4.1.0\nBest match: jaraco.functools 4.1.0\nAdding jaraco.functools 4.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for httpcore==1.0.7\nBest match: httpcore 1.0.7\nAdding httpcore 1.0.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for anyio==4.5.2\nBest match: anyio 4.5.2\nAdding anyio 4.5.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for six==1.17.0\nBest match: six 1.17.0\nAdding six 1.17.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for plotly==5.24.1\nBest match: plotly 5.24.1\nAdding plotly 5.24.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for graphviz==0.20.3\nBest match: graphviz 0.20.3\nAdding graphviz 0.20.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for tornado==6.4.2\nBest match: tornado 6.4.2\nAdding tornado 6.4.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for pyzmq==26.2.0\nBest match: pyzmq 26.2.0\nAdding pyzmq 26.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for psutil==6.1.1\nBest match: psutil 6.1.1\nAdding psutil 6.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for nest-asyncio==1.6.0\nBest match: nest-asyncio 1.6.0\nAdding nest-asyncio 1.6.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for matplotlib-inline==0.1.7\nBest match: matplotlib-inline 0.1.7\nAdding matplotlib-inline 0.1.7 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for ipython==8.12.3\nBest match: ipython 8.12.3\nAdding ipython 8.12.3 to easy-install.pth file\nInstalling ipython script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\nInstalling ipython3 script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for debugpy==1.8.11\nBest match: debugpy 1.8.11\nAdding debugpy 1.8.11 to easy-install.pth file\nInstalling debugpy script to /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/bin\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for comm==0.2.2\nBest match: comm 0.2.2\nAdding comm 0.2.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for platformdirs==4.3.6\nBest match: platformdirs 4.3.6\nAdding platformdirs 4.3.6 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for url-normalize==1.4.3\nBest match: url-normalize 1.4.3\nAdding url-normalize 1.4.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for cattrs==24.1.2\nBest match: cattrs 24.1.2\nAdding cattrs 24.1.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for attrs==24.3.0\nBest match: attrs 24.3.0\nAdding attrs 24.3.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for zipp==3.20.2\nBest match: zipp 3.20.2\nAdding zipp 3.20.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for backports.tarfile==1.2.0\nBest match: backports.tarfile 1.2.0\nbackports.tarfile 1.2.0 is already the active version in easy-install.pth\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/setuptools/_vendor\nSearching for more-itertools==10.5.0\nBest match: more-itertools 10.5.0\nAdding more-itertools 10.5.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for cryptography==44.0.0\nBest match: cryptography 44.0.0\nAdding cryptography 44.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for h11==0.14.0\nBest match: h11 0.14.0\nAdding h11 0.14.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for exceptiongroup==1.2.2\nBest match: exceptiongroup 1.2.2\nAdding exceptiongroup 1.2.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for sniffio==1.3.1\nBest match: sniffio 1.3.1\nAdding sniffio 1.3.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for tenacity==9.0.0\nBest match: tenacity 9.0.0\nAdding tenacity 9.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for pexpect==4.9.0\nBest match: pexpect 4.9.0\nAdding pexpect 4.9.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for stack-data==0.6.3\nBest match: stack-data 0.6.3\nAdding stack-data 0.6.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for prompt-toolkit==3.0.48\nBest match: prompt-toolkit 3.0.48\nAdding prompt-toolkit 3.0.48 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for pickleshare==0.7.5\nBest match: pickleshare 0.7.5\nAdding pickleshare 0.7.5 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for jedi==0.19.2\nBest match: jedi 0.19.2\nAdding jedi 0.19.2 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for decorator==5.1.1\nBest match: decorator 5.1.1\nAdding decorator 5.1.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for backcall==0.2.0\nBest match: backcall 0.2.0\nAdding backcall 0.2.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for cffi==1.17.1\nBest match: cffi 1.17.1\nAdding cffi 1.17.1 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for ptyprocess==0.7.0\nBest match: ptyprocess 0.7.0\nAdding ptyprocess 0.7.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for pure-eval==0.2.3\nBest match: pure-eval 0.2.3\nAdding pure-eval 0.2.3 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for asttokens==3.0.0\nBest match: asttokens 3.0.0\nAdding asttokens 3.0.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for executing==2.1.0\nBest match: executing 2.1.0\nAdding executing 2.1.0 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for wcwidth==0.2.13\nBest match: wcwidth 0.2.13\nAdding wcwidth 0.2.13 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for parso==0.8.4\nBest match: parso 0.8.4\nAdding parso 0.8.4 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nSearching for pycparser==2.22\nBest match: pycparser 2.22\nAdding pycparser 2.22 to easy-install.pth file\n\nUsing /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages\nFinished processing dependencies for Orange3==3.37.0.dev0+659130d\nVerifying Orange installation...\n✅ Orange installation successful!\nSuccessfully installed orange using Python 3.8\n",
    "setup_res_stderr": "Using CPython 3.7.9\nCreating virtual environment at: .venv\nActivate with: source .venv/bin/activate\nResolved 18 packages in 186ms\nPrepared 18 packages in 1ms\nInstalled 18 packages in 171ms\n + cython==0.29.37\n + exceptiongroup==1.2.2\n + importlib-metadata==6.7.0\n + iniconfig==2.0.0\n + numpy==1.17.5\n + packaging==24.0\n + pluggy==1.2.0\n + pyqt5==5.15.10\n + pyqt5-qt5==5.15.16\n + pyqt5-sip==12.13.0\n + pyqtwebengine==5.15.6\n + pyqtwebengine-qt5==5.15.16\n + pytest==7.4.4\n + setuptools==59.8.0\n + tomli==2.0.1\n + typing-extensions==4.7.1\n + wheel==0.42.0\n + zipp==3.15.0\n  × No solution found when resolving dependencies:\n  ╰─▶ Because the current Python version (3.7.9) does not satisfy Python>=3.8 and all of:\n          pandas>=1.4.0,<=1.4.4\n          pandas>=1.5.1,<=1.5.3\n          pandas>=2.0.1,<=2.0.3\n      depend on Python>=3.8, we can conclude that all of:\n          pandas>=1.4.0,<=1.4.4\n          pandas>=1.5.1,<=1.5.3\n          pandas>=2.0.1,<=2.0.3\n       cannot be used.\n      And because only the following versions of pandas are available:\n          pandas<=1.4.0\n          pandas==1.4.1\n          pandas==1.4.2\n          pandas==1.4.3\n          pandas==1.4.4\n          pandas==1.5.0\n          pandas==1.5.1\n          pandas==1.5.2\n          pandas==1.5.3\n          pandas==2.0.0\n          pandas==2.0.1\n          pandas==2.0.2\n          pandas==2.0.3\n          pandas==2.1.0\n          pandas==2.1.1\n          pandas==2.1.2\n          pandas==2.1.3\n          pandas==2.1.4\n          pandas==2.2.0\n          pandas==2.2.1\n          pandas==2.2.2\n          pandas==2.2.3\n      we can conclude that all of:\n          pandas>=1.4.0,<1.5.0\n          pandas>1.5.0,<2.0.0\n          pandas>2.0.0,<2.1.0\n       cannot be used. (1)\n\n      Because the current Python version (3.7.9) does not satisfy Python>=3.9 and pandas>=2.1.0 depends on Python>=3.9, we can\n      conclude that pandas>=2.1.0 cannot be used.\n      And because we know from (1) that all of:\n          pandas>=1.4.0,<1.5.0\n          pandas>1.5.0,<2.0.0\n          pandas>2.0.0,<2.1.0\n       cannot be used, we can conclude that all of:\n          pandas>=1.4.0,<1.5.0\n          pandas>1.5.0,<2.0.0\n          pandas>2.0.0\n       cannot be used.\n      And because you require one of:\n          pandas>=1.4.0,<1.5.0\n          pandas>1.5.0,<2.0.0\n          pandas>2.0.0\n      we can conclude that your requirements are unsatisfiable.\n\n      hint: Pre-releases are available for `pandas` in the requested range (e.g., 2.2.0rc0), but pre-releases weren't enabled\n      (try: `--prerelease=allow`)\n  × No solution found when resolving dependencies:\n  ╰─▶ Because the current Python version (3.7.9) does not satisfy Python>=3.8 and pyqtgraph>=0.13.1,<=0.13.3 depends on\n      Python>=3.8, we can conclude that pyqtgraph>=0.13.1,<=0.13.3 cannot be used.\n      And because only the following versions of pyqtgraph are available:\n          pyqtgraph<=0.13.1\n          pyqtgraph==0.13.2\n          pyqtgraph==0.13.3\n          pyqtgraph==0.13.4\n          pyqtgraph==0.13.5\n          pyqtgraph==0.13.6\n          pyqtgraph==0.13.7\n      we can conclude that pyqtgraph>=0.13.1,<0.13.4 cannot be used. (1)\n\n      Because the current Python version (3.7.9) does not satisfy Python>=3.9 and pyqtgraph>=0.13.4 depends on Python>=3.9, we\n      can conclude that pyqtgraph>=0.13.4 cannot be used.\n      And because we know from (1) that pyqtgraph>=0.13.1,<0.13.4 cannot be used, we can conclude that pyqtgraph>=0.13.1 cannot\n      be used.\n      And because you require pyqtgraph>=0.13.1, we can conclude that your requirements are unsatisfiable.\nResolved 2 packages in 53ms\nInstalled 2 packages in 13ms\n + psycopg2==2.9.9\n + pymssql==2.3.2\nResolved 5 packages in 120ms\nInstalled 4 packages in 328ms\n + joblib==1.3.2\n + scikit-learn==1.0.2\n + scipy==1.7.3\n + threadpoolctl==3.1.0\nOrange/classification/_simple_tree.c: In function ‘gain_ratio_c’:\nOrange/classification/_simple_tree.c:63:9: warning: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Wimplicit-function-declaration]\n   63 |         qsort_r(base, nel, size, compar, thunk)\n      |         ^~~~~~~\nOrange/classification/_simple_tree.c:147:9: note: in expansion of macro ‘QSORT_R_FUNC’\n  147 |         QSORT_R_FUNC(examples, size, sizeof(struct Example), (void*) &compar_attr, compar_examples);\n      |         ^~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/classification/_tree_scorers.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_2find_threshold_entropy’:\nOrange/classification/_tree_scorers.c:3426:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3426 |   __pyx_t_7 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_6find_threshold_MSE’:\nOrange/classification/_tree_scorers.c:4872:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4872 |   __pyx_t_1 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_8find_binarization_MSE’:\nOrange/classification/_tree_scorers.c:5618:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5618 |           for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5739:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5739 |           __pyx_t_20 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5745:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5745 |           __pyx_t_20 = (((__pyx_v_N - __pyx_v_left) >= __pyx_v_min_leaf) != 0);\n      |                                                     ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_14compute_predictions_csr’:\nOrange/classification/_tree_scorers.c:7206:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7206 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_16compute_predictions_csc’:\nOrange/classification/_tree_scorers.c:7863:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7863 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7923:150: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7923 |               __pyx_t_16 = (((*((__pyx_t_5numpy_int32_t const  *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_15 * __pyx_v_indices.strides[0]) ))) != __pyx_v_i) != 0);\n      |                                                                                                                                                      ^~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/data/_contingency.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/data/_io.c: In function ‘__pyx_pf_6Orange_4data_3_io_sparse_read_float.constprop’:\nOrange/data/_io.c:4120:43: warning: ‘__pyx_v_decs’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4120 |           __pyx_v_value = ((__pyx_v_value * __pyx_v_decs) + (__pyx_v_c & 0xf));\n      |                            ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/data/_io.c:4318:24: warning: ‘__pyx_v_value’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4318 |           __pyx_t_10 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 223, __pyx_L5_error)\n      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:683:40: warning: ‘__pyx_v_attr_index’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n  683 |   #define PyInt_FromLong               PyLong_FromLong\n      |                                        ^~~~~~~~~~~~~~~\nOrange/data/_io.c:1590:7: note: ‘__pyx_v_attr_index’ was declared here\n 1590 |   int __pyx_v_attr_index;\n      |       ^~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:3183:25: warning: ‘__pyx_v_atomp’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3183 |           __pyx_v_atomp = (__pyx_v_atomp + 1);\n      |           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/data/_valuecount.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/distance/_distance.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/preprocess/_discretize.c:774:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/preprocess/_relieff.cpp:790:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,\n                 from Orange/projection/_som.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_5update_hex’:\nOrange/projection/_som.c:3944:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3944 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3943:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3943 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_8update_sparse.constprop’:\nOrange/projection/_som.c:5094:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5094 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5093:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5093 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_1get_winners’:\nOrange/projection/_som.c:3244:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3244 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2892:7: note: ‘__pyx_v_win_y’ was declared here\n 2892 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3233:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3233 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2891:7: note: ‘__pyx_v_win_x’ was declared here\n 2891 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_10update_sparse_hex.constprop’:\nOrange/projection/_som.c:5842:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5842 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5841:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5841 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_7get_winners_sparse’:\nOrange/projection/_som.c:4871:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4871 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4389:7: note: ‘__pyx_v_win_y’ was declared here\n 4389 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4860:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4860 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4388:7: note: ‘__pyx_v_win_x’ was declared here\n 4388 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_3update’:\nOrange/projection/_som.c:3438:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3438 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/setuptools/command/easy_install.py:159: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.\n  EasyInstallDeprecationWarning,\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.\n  setuptools.SetuptoolsDeprecationWarning,\nwarning: no files found matching 'README*' under directory 'Orange'\nwarning: no files found matching 'LICENSE' under directory 'Orange'\nwarning: no files found matching '*.basket' under directory 'Orange/datasets'\nwarning: no files found matching '*.svg' under directory 'Orange/canvas'\nwarning: no files found matching '*.js' under directory 'Orange/widgets'\nwarning: no files found matching '*.css' under directory 'Orange/widgets'\nwarning: no files found matching '*.html' under directory 'Orange/widgets'\nwarning: no files found matching '*.svg' under directory 'distribute'\nwarning: no files found matching 'COPYING'\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/pkg_resources/__init__.py:119: PkgResourcesDeprecationWarning:  is an invalid version and will not be supported in a future release\n  PkgResourcesDeprecationWarning,\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.\n  setuptools.SetuptoolsDeprecationWarning,\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.7/site-packages/pkg_resources/__init__.py:119: PkgResourcesDeprecationWarning:  is an invalid version and will not be supported in a future release\n  PkgResourcesDeprecationWarning,\nerror: Couldn't find a setup script in /tmp/easy_install-3eugwrcr/scipy-1.15.0.tar.gz\nUsing CPython 3.8.20\nCreating virtual environment at: .venv\nActivate with: source .venv/bin/activate\nResolved 15 packages in 81ms\nPrepared 15 packages in 1ms\nInstalled 15 packages in 53ms\n + cython==0.29.37\n + exceptiongroup==1.2.2\n + iniconfig==2.0.0\n + numpy==1.24.4\n + packaging==24.2\n + pluggy==1.5.0\n + pyqt5==5.15.11\n + pyqt5-qt5==5.15.16\n + pyqt5-sip==12.15.0\n + pyqtwebengine==5.15.7\n + pyqtwebengine-qt5==5.15.16\n + pytest==8.3.4\n + setuptools==75.3.0\n + tomli==2.2.1\n + wheel==0.45.1\nResolved 65 packages in 108ms\nInstalled 61 packages in 435ms\n + anyio==4.5.2\n + backports-tarfile==1.2.0\n + baycomp==1.0.3\n + bottleneck==1.4.0\n + catboost==1.2.7\n + certifi==2024.12.14\n + cffi==1.17.1\n + chardet==5.2.0\n + charset-normalizer==3.4.1\n + contourpy==1.1.1\n + cryptography==44.0.0\n + cycler==0.12.1\n + et-xmlfile==2.0.0\n + fonttools==4.55.3\n + graphviz==0.20.3\n + h11==0.14.0\n + httpcore==1.0.7\n + httpx==0.28.1\n + idna==3.10\n + importlib-metadata==8.5.0\n + importlib-resources==6.4.5\n + jaraco-classes==3.4.0\n + jaraco-context==6.0.1\n + jaraco-functools==4.1.0\n + jeepney==0.8.0\n + joblib==1.4.2\n + keyring==25.5.0\n + keyrings-alt==5.0.2\n + kiwisolver==1.4.7\n + matplotlib==3.7.5\n + more-itertools==10.5.0\n + networkx==3.1\n + nvidia-nccl-cu12==2.24.3\n + openpyxl==3.1.5\n + opentsne==1.0.1\n + pandas==2.0.3\n + pillow==10.4.0\n + pip==24.3.1\n + plotly==5.24.1\n + pycparser==2.22\n + pyparsing==3.1.4\n + python-dateutil==2.9.0.post0\n + python-louvain==0.16\n + pytz==2024.2\n + pyyaml==6.0.2\n + requests==2.32.3\n + scikit-learn==1.1.3\n + scipy==1.10.1\n + secretstorage==3.3.3\n + serverfiles==0.3.1\n + six==1.17.0\n + sniffio==1.3.1\n + tenacity==9.0.0\n + threadpoolctl==3.5.0\n + typing-extensions==4.12.2\n + tzdata==2024.2\n + urllib3==2.2.3\n + xgboost==2.1.3\n + xlrd==2.0.1\n + xlsxwriter==3.2.0\n + zipp==3.20.2\nResolved 64 packages in 113ms\nInstalled 41 packages in 110ms\n + anyqt==0.2.0\n + asttokens==3.0.0\n + attrs==24.3.0\n + backcall==0.2.0\n + cattrs==24.1.2\n + comm==0.2.2\n + commonmark==0.9.1\n + debugpy==1.8.11\n + decorator==5.1.1\n + dictdiffer==0.9.0\n + docutils==0.20.1\n + executing==2.1.0\n + ipykernel==6.29.5\n + ipython==8.12.3\n + jedi==0.19.2\n + jupyter-client==8.6.3\n + jupyter-core==5.7.2\n + matplotlib-inline==0.1.7\n + nest-asyncio==1.6.0\n + orange-canvas-core==0.1.35\n + orange-widget-base==4.22.0\n + parso==0.8.4\n + pexpect==4.9.0\n + pickleshare==0.7.5\n + platformdirs==4.3.6\n + prompt-toolkit==3.0.48\n + psutil==6.1.1\n + ptyprocess==0.7.0\n + pure-eval==0.2.3\n + pygments==2.19.1\n + pyqtgraph==0.13.3\n + pyzmq==26.2.0\n + qasync==0.27.1\n + qtconsole==5.6.1\n + qtpy==2.4.2\n + requests-cache==1.2.1\n + stack-data==0.6.3\n + tornado==6.4.2\n + traitlets==5.14.3\n + url-normalize==1.4.3\n + wcwidth==0.2.13\nResolved 2 packages in 2ms\nInstalled 2 packages in 4ms\n + psycopg2==2.9.10\n + pymssql==2.3.2\nOrange/classification/_simple_tree.c: In function ‘gain_ratio_c’:\nOrange/classification/_simple_tree.c:63:9: warning: implicit declaration of function ‘qsort_r’; did you mean ‘qsort’? [-Wimplicit-function-declaration]\n   63 |         qsort_r(base, nel, size, compar, thunk)\n      |         ^~~~~~~\nOrange/classification/_simple_tree.c:147:9: note: in expansion of macro ‘QSORT_R_FUNC’\n  147 |         QSORT_R_FUNC(examples, size, sizeof(struct Example), (void*) &compar_attr, compar_examples);\n      |         ^~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/classification/_tree_scorers.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_2find_threshold_entropy’:\nOrange/classification/_tree_scorers.c:3426:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 3426 |   __pyx_t_7 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_6find_threshold_MSE’:\nOrange/classification/_tree_scorers.c:4872:27: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 4872 |   __pyx_t_1 = ((__pyx_v_N <= __pyx_v_min_leaf) != 0);\n      |                           ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_8find_binarization_MSE’:\nOrange/classification/_tree_scorers.c:5618:43: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5618 |           for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) {\n      |                                           ^\nOrange/classification/_tree_scorers.c:5739:39: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5739 |           __pyx_t_20 = ((__pyx_v_left >= __pyx_v_min_leaf) != 0);\n      |                                       ^~\nOrange/classification/_tree_scorers.c:5745:53: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 5745 |           __pyx_t_20 = (((__pyx_v_N - __pyx_v_left) >= __pyx_v_min_leaf) != 0);\n      |                                                     ^~\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_14compute_predictions_csr’:\nOrange/classification/_tree_scorers.c:7206:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7206 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c: In function ‘__pyx_pf_6Orange_14classification_13_tree_scorers_16compute_predictions_csc’:\nOrange/classification/_tree_scorers.c:7863:41: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]\n 7863 |         for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {\n      |                                         ^\nOrange/classification/_tree_scorers.c:7923:150: warning: comparison of integer expressions of different signedness: ‘__pyx_t_5numpy_int32_t’ {aka ‘int’} and ‘unsigned int’ [-Wsign-compare]\n 7923 |               __pyx_t_16 = (((*((__pyx_t_5numpy_int32_t const  *) ( /* dim=0 */ (__pyx_v_indices.data + __pyx_t_15 * __pyx_v_indices.strides[0]) ))) != __pyx_v_i) != 0);\n      |                                                                                                                                                      ^~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/data/_contingency.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/data/_io.c: In function ‘__pyx_pf_6Orange_4data_3_io_sparse_read_float.constprop’:\nOrange/data/_io.c:4120:43: warning: ‘__pyx_v_decs’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4120 |           __pyx_v_value = ((__pyx_v_value * __pyx_v_decs) + (__pyx_v_c & 0xf));\n      |                            ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/data/_io.c:4318:24: warning: ‘__pyx_v_value’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4318 |           __pyx_t_10 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 223, __pyx_L5_error)\n      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:683:40: warning: ‘__pyx_v_attr_index’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n  683 |   #define PyInt_FromLong               PyLong_FromLong\n      |                                        ^~~~~~~~~~~~~~~\nOrange/data/_io.c:1590:7: note: ‘__pyx_v_attr_index’ was declared here\n 1590 |   int __pyx_v_attr_index;\n      |       ^~~~~~~~~~~~~~~~~~\nOrange/data/_io.c:3183:25: warning: ‘__pyx_v_atomp’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3183 |           __pyx_v_atomp = (__pyx_v_atomp + 1);\n      |           ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/data/_valuecount.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/distance/_distance.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/preprocess/_discretize.c:774:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/preprocess/_relieff.cpp:790:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nIn file included from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1940,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,\n                 from /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,\n                 from Orange/projection/_som.c:775:\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning \"Using deprecated NumPy API, disable it with \" \"#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION\" [-Wcpp]\n   17 | #warning \"Using deprecated NumPy API, disable it with \" \\\n      |  ^~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_5update_hex’:\nOrange/projection/_som.c:3944:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3944 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3943:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3943 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_8update_sparse.constprop’:\nOrange/projection/_som.c:5094:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5094 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5093:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5093 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_3update’:\nOrange/projection/_som.c:3438:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3438 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_1get_winners’:\nOrange/projection/_som.c:3244:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3244 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2892:7: note: ‘__pyx_v_win_y’ was declared here\n 2892 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:3233:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 3233 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:2891:7: note: ‘__pyx_v_win_x’ was declared here\n 2891 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pf_6Orange_10projection_4_som_10update_sparse_hex.constprop’:\nOrange/projection/_som.c:5842:7: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5842 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:5841:7: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 5841 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c: In function ‘__pyx_pw_6Orange_10projection_4_som_7get_winners_sparse’:\nOrange/projection/_som.c:4871:223: warning: ‘__pyx_v_win_y’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4871 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_y;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4389:7: note: ‘__pyx_v_win_y’ was declared here\n 4389 |   int __pyx_v_win_y;\n      |       ^~~~~~~~~~~~~\nOrange/projection/_som.c:4860:223: warning: ‘__pyx_v_win_x’ may be used uninitialized in this function [-Wmaybe-uninitialized]\n 4860 |           *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_int16_t *, __pyx_pybuffernd_winners.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_winners.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_winners.diminfo[1].strides) = __pyx_v_win_x;\n      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~\nOrange/projection/_som.c:4388:7: note: ‘__pyx_v_win_x’ was declared here\n 4388 |   int __pyx_v_win_x;\n      |       ^~~~~~~~~~~~~\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_suite'\n  warnings.warn(msg)\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_suite'\n  warnings.warn(msg)\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/setuptools/command/develop.py:41: EasyInstallDeprecationWarning: easy_install command is deprecated.\n!!\n\n        ********************************************************************************\n        Please avoid running ``setup.py`` and ``easy_install``.\n        Instead, use pypa/build, pypa/installer or other\n        standards-based tools.\n\n        See https://github.com/pypa/setuptools/issues/917 for details.\n        ********************************************************************************\n\n!!\n  easy_install.initialize_options(self)\n/home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542/.venv/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.\n!!\n\n        ********************************************************************************\n        Please avoid running ``setup.py`` directly.\n        Instead, use pypa/build, pypa/installer or other\n        standards-based tools.\n\n        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.\n        ********************************************************************************\n\n!!\n  self.initialize_options()\nwarning: no files found matching 'README*' under directory 'Orange'\nwarning: no files found matching 'LICENSE' under directory 'Orange'\nwarning: no files found matching '*.basket' under directory 'Orange/datasets'\nwarning: no files found matching '*.svg' under directory 'Orange/canvas'\nwarning: no files found matching '*.js' under directory 'Orange/widgets'\nwarning: no files found matching '*.css' under directory 'Orange/widgets'\nwarning: no files found matching '*.html' under directory 'Orange/widgets'\nwarning: no files found matching '*.svg' under directory 'distribute'\nwarning: no files found matching 'COPYING'\n",
    "new_commit_res_code": 0,
    "new_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.8.20, pytest-8.3.4, pluggy-1.5.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542\nconfigfile: pyproject.toml\nplugins: anyio-4.5.2, typeguard-4.3.0\ncollected 36 items\n\nr2e_tests/test_1.py sss.................................                 [100%]\n\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_attr_label_metas\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_attr_models\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_class_density\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_datasets\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_default_attrs\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_dragging_tooltip\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_exaggeration_is_passed_through_properly\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_handle_primitive_metas\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_hidden_effective_variables\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_image_export\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_input\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_invalidated_embedding\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_invalidation_flow\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_minimum_size\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_modified_info_message_behaviour\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_multiscale_changed_updates_ui\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_none_data\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_normalize_data\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_outputs\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_pca_preprocessing_warning_with_large_number_of_features\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_plot_once\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_saved_selection\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_send_report\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_setup_graph\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_sparse_data\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_subset_data_color\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_visual_settings\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_wrong_input\nPASSED r2e_tests/test_1.py::TestTSNERunner::test_run_do_not_modify_model_inplace\nPASSED r2e_tests/test_1.py::TestTSNERunner::test_run_with_normalization\nPASSED r2e_tests/test_1.py::TestTSNERunner::test_run_with_normalization_and_pca_preprocessing\nPASSED r2e_tests/test_1.py::TestTSNERunner::test_run_with_pca_preprocessing\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\n======================== 33 passed, 3 skipped in 16.64s ========================\nWidgets left: 0    Max widgets: 6892 \n\n",
    "new_commit_res_stderr": "",
    "old_commit_res_code": 1,
    "old_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.8.20, pytest-8.3.4, pluggy-1.5.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/orange3_659130d3cb87fa9aec1eddbb5636b2c646fc1542\nconfigfile: pyproject.toml\nplugins: anyio-4.5.2, typeguard-4.3.0\ncollected 36 items\n\nr2e_tests/test_1.py sss....................F............                 [100%]\n\n=================================== FAILURES ===================================\n___ TestOWtSNE.test_pca_preprocessing_warning_with_large_number_of_features ____\n\nself = <r2e_tests.test_1.TestOWtSNE testMethod=test_pca_preprocessing_warning_with_large_number_of_features>\n\n    def test_pca_preprocessing_warning_with_large_number_of_features(self):\n        self.assertFalse(\n>           self.widget.Warning.consider_using_pca_preprocessing.is_shown(),\n            \"The PCA warning should be hidden by default\"\n        )\nE       AttributeError: 'Warning' object has no attribute 'consider_using_pca_preprocessing'\n\nr2e_tests/test_1.py:367: AttributeError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_attr_label_metas\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_attr_models\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_class_density\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_datasets\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_default_attrs\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_dragging_tooltip\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_exaggeration_is_passed_through_properly\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_handle_primitive_metas\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_hidden_effective_variables\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_image_export\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_input\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_invalidated_embedding\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_invalidation_flow\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_minimum_size\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_modified_info_message_behaviour\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_msg_base_class\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_multiscale_changed_updates_ui\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_none_data\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_normalize_data\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_outputs\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_plot_once\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_saved_selection\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_send_report\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_setup_graph\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_sparse_data\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_subset_data_color\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_visual_settings\nPASSED r2e_tests/test_1.py::TestOWtSNE::test_wrong_input\nPASSED r2e_tests/test_1.py::TestTSNERunner::test_run_do_not_modify_model_inplace\nPASSED r2e_tests/test_1.py::TestTSNERunner::test_run_with_normalization\nPASSED r2e_tests/test_1.py::TestTSNERunner::test_run_with_normalization_and_pca_preprocessing\nPASSED r2e_tests/test_1.py::TestTSNERunner::test_run_with_pca_preprocessing\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:244: image exporting not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:238: minimum size not tested as .widget was not set\nSKIPPED [1] .venv/lib/python3.8/site-packages/orangewidget/tests/base.py:250: msg base class not tested as .widget was not set\nFAILED r2e_tests/test_1.py::TestOWtSNE::test_pca_preprocessing_warning_with_large_number_of_features\n=================== 1 failed, 32 passed, 3 skipped in 14.37s ===================\nWidgets left: 0    Max widgets: 6892 \n\n",
    "old_commit_res_stderr": ""
}
Orange/widgets/unsupervised/owtsne.py Orange/widgets/unsupervised/tests/test_owtsne.py
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
**Analysis:**

- **Key Parts from Commit Details:**
  - **Commit Message:** `owtsne: Warn if PCA disabled and large number of features.`
  - **Change:** Added a warning message when PCA preprocessing is disabled and the input data has a large number of features.
  - **Test Results:** Previously, the test `test_pca_preprocessing_warning_with_large_number_of_features` failed with an `AttributeError` because the warning was not implemented.

- **Main Problem Highlighted by Test Results:**
  - The widget is expected to display a warning when PCA preprocessing is disabled and the dataset has a large number of features. However, before the commit, this warning was not present, causing the test to fail.

- **Expected Behavior:**
  - When PCA preprocessing is disabled and the dataset contains many features, the widget should display a warning advising the user to enable PCA preprocessing to improve performance.

- **Actual Behavior or Error Message:**
  - The warning is not displayed, leading to potential performance issues without user awareness.

- **Issue Description:**
  - The issue should clearly state that the widget fails to display a necessary warning under specific conditions, providing details on how to reproduce the problem and what the expected outcome should be.

---

[ISSUE]
**Title:** Missing Warning When PCA Preprocessing is Disabled with High-Dimensional Data

**Description:**

When PCA preprocessing is turned off in the t-SNE widget and the input dataset contains a large number of features, the widget does not display a warning. This omission can lead to unexpected slowdowns during computation without informing the user of the potential performance impact.

**Steps to Reproduce:**

1. Open the t-SNE widget in the application.
2. Disable the PCA preprocessing option.
3. Input a dataset with a high number of features (e.g., 250 features).
4. Run the t-SNE computation.

**Expected Behavior:**

A warning message should appear indicating that the input data has a large number of features and recommending enabling PCA preprocessing to enhance computation speed.

**Actual Behavior:**

No warning is displayed, leaving users unaware that disabling PCA preprocessing with high-dimensional data may result in slower performance.

**Example Code Snippet:**

```python
# Example setup in the widget
widget.controls.use_pca_preprocessing.setChecked(False)
data_large = Table.from_numpy(Domain.from_numpy(np.random.normal(0, 1, size=(50, 250))), np.random.normal(0, 1, size=(50, 250)))
widget.send_signal(widget.Inputs.data, data_large)
widget.run_button.click()
# Expected: Warning.consider_using_pca_preprocessing is_shown()
# Actual: AttributeError or no warning displayed
```
[/ISSUE]
--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.

--- BEGIN FILE ---
```
### Orange/widgets/unsupervised/owtsne.py
import warnings
from functools import partial
from types import SimpleNamespace as namespace
from typing import Optional  # pylint: disable=unused-import

import numpy as np

from AnyQt.QtCore import Qt
from AnyQt.QtWidgets import QFormLayout

from Orange.data import Table, Domain
from Orange.preprocess import preprocess
from Orange.projection import PCA
from Orange.projection import manifold
from Orange.widgets import gui
from Orange.widgets.settings import SettingProvider, ContextSetting
from Orange.widgets.utils.concurrent import TaskState, ConcurrentWidgetMixin
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.visualize.owscatterplotgraph import OWScatterPlotBase
from Orange.widgets.visualize.utils.widget import OWDataProjectionWidget
from Orange.widgets.widget import Msg

_STEP_SIZE = 25
_MAX_PCA_COMPONENTS = 50
_DEFAULT_PCA_COMPONENTS = 20


class Task(namespace):
    """Completely determines the t-SNE task spec and intermediate results."""
    data = None                     # type: Optional[Table]

    normalize = None                # type: Optional[bool]
    normalized_data = None          # type: Optional[Table]

    use_pca_preprocessing = None    # type: Optional[bool]
    pca_components = None           # type: Optional[int]
    pca_projection = None           # type: Optional[Table]

    perplexity = None               # type: Optional[float]
    multiscale = None               # type: Optional[bool]
    exaggeration = None             # type: Optional[float]
    initialization = None           # type: Optional[np.ndarray]
    affinities = None               # type: Optional[openTSNE.affinity.Affinities]
    tsne_embedding = None           # type: Optional[manifold.TSNEModel]
    iterations_done = 0             # type: int

    # These attributes need not be set by the widget
    tsne = None                     # type: Optional[manifold.TSNE]
    # `effective_data` stores the current working matrix which should be used
    # for any steps depending on the data matrix. For instance, normalization
    # should use the effective data (presumably the original data), and set it
    # to the normalized version upon completion. This can then later be used for
    # PCA preprocessing
    effective_data = None           # type: Optional[Table]

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        # Set `effective_data` to data if data provided, and effective data
        # not provided
        if self.effective_data is None and self.data is not None:
            self.effective_data = self.data


def data_normalization(data):
    normalization = preprocess.Normalize()
    return normalization(data)


def pca_preprocessing(data, n_components):
    projector = PCA(n_components=n_components, random_state=0)
    model = projector(data)
    return model(data)


def prepare_tsne_obj(data, perplexity, multiscale, exaggeration):
    # type: (Table, float, bool, float) -> manifold.TSNE
    """Automatically determine the best parameters for the given data set."""
    # Compute perplexity settings for multiscale
    n_samples = data.X.shape[0]
    if multiscale:
        perplexity = min((n_samples - 1) / 3, 50), min((n_samples - 1) / 3, 500)
    else:
        perplexity = perplexity

    return manifold.TSNE(
        n_components=2,
        perplexity=perplexity,
        multiscale=multiscale,
        exaggeration=exaggeration,
        random_state=0,
    )


class TSNERunner:
    @staticmethod
    def compute_normalization(task: Task, state: TaskState, **_) -> None:
        state.set_status("Normalizing data...")
        task.normalized_data = data_normalization(task.effective_data)
        task.effective_data = task.normalized_data
        state.set_partial_result(("normalized_data", task))

    @staticmethod
    def compute_pca(task: Task, state: TaskState, **_) -> None:
        # Perform PCA preprocessing
        state.set_status("Computing PCA...")
        pca_projection = pca_preprocessing(task.effective_data, task.pca_components)
        # Apply t-SNE's preprocessors to the data
        task.pca_projection = task.tsne.preprocess(pca_projection)
        task.effective_data = task.pca_projection
        state.set_partial_result(("pca_projection", task))

    @staticmethod
    def compute_initialization(task: Task, state: TaskState, **_) -> None:
        # Prepare initial positions for t-SNE
        state.set_status("Preparing initialization...")
        task.initialization = task.tsne.compute_initialization(task.effective_data.X)
        state.set_partial_result(("initialization", task))

    @staticmethod
    def compute_affinities(task: Task, state: TaskState, **_) -> None:
        # Compute affinities
        state.set_status("Finding nearest neighbors...")
        task.affinities = task.tsne.compute_affinities(task.effective_data.X)
        state.set_partial_result(("affinities", task))

    @staticmethod
    def compute_tsne(task: Task, state: TaskState, progress_callback=None) -> None:
        tsne = task.tsne

        state.set_status("Running optimization...")

        # If this the first time we're computing t-SNE (otherwise we may just
        # be resuming optimization), we have to assemble the tsne object
        if task.tsne_embedding is None:
            # Assemble a t-SNE embedding object and convert it to a TSNEModel
            task.tsne_embedding = tsne.prepare_embedding(
                task.affinities, task.initialization
            )
            task.tsne_embedding = tsne.convert_embedding_to_model(
                task.effective_data, task.tsne_embedding
            )
            state.set_partial_result(("tsne_embedding", task))

            if state.is_interruption_requested():
                return

        total_iterations_needed = tsne.early_exaggeration_iter + tsne.n_iter

        def run_optimization(tsne_params: dict, iterations_needed: int) -> bool:
            """Run t-SNE optimization phase. Return value indicates whether the
            optimization was interrupted."""
            while task.iterations_done < iterations_needed:
                # Step size can't be larger than the remaining number of iterations
                step_size = min(_STEP_SIZE, iterations_needed - task.iterations_done)
                task.tsne_embedding = task.tsne_embedding.optimize(
                    step_size, **tsne_params
                )
                task.iterations_done += step_size
                state.set_partial_result(("tsne_embedding", task))
                if progress_callback is not None:
                    # The current iterations must be divided by the total
                    # number of iterations, not the number of iterations in the
                    # current phase (iterations_needed)
                    progress_callback(task.iterations_done / total_iterations_needed)

                if state.is_interruption_requested():
                    return True

        # Run early exaggeration phase
        was_interrupted = run_optimization(
            dict(exaggeration=tsne.early_exaggeration, momentum=0.8, inplace=False),
            iterations_needed=tsne.early_exaggeration_iter,
        )
        if was_interrupted:
            return
        # Run regular optimization phase
        run_optimization(
            dict(exaggeration=tsne.exaggeration, momentum=0.8, inplace=False),
            iterations_needed=total_iterations_needed,
        )

    @classmethod
    def run(cls, task: Task, state: TaskState) -> Task:
        # Assign weights to each job indicating how much time will be spent on each
        weights = {"normalization": 1, "pca": 1, "init": 1, "aff": 25, "tsne": 50}
        total_weight = sum(weights.values())

        # Prepare the tsne object and add it to the spec
        task.tsne = prepare_tsne_obj(
            task.data, task.perplexity, task.multiscale, task.exaggeration
        )

        job_queue = []
        # Add the tasks that still need to be run to the job queue
        task.effective_data = task.data

        if task.normalize and task.normalized_data is None:
            job_queue.append((cls.compute_normalization, weights["normalization"]))

        if task.use_pca_preprocessing and task.pca_projection is None:
            job_queue.append((cls.compute_pca, weights["pca"]))

        if task.initialization is None:
            job_queue.append((cls.compute_initialization, weights["init"]))

        if task.affinities is None:
            job_queue.append((cls.compute_affinities, weights["aff"]))

        total_iterations = task.tsne.early_exaggeration_iter + task.tsne.n_iter
        if task.tsne_embedding is None or task.iterations_done < total_iterations:
            job_queue.append((cls.compute_tsne, weights["tsne"]))

        job_queue = [(partial(f, task, state), w) for f, w in job_queue]

        # Ensure the effective data is set to the appropriate, potentially
        # precomputed matrix
        task.effective_data = task.data
        if task.normalize and task.normalized_data is not None:
            task.effective_data = task.normalized_data
        if task.use_pca_preprocessing and task.pca_projection is not None:
            task.effective_data = task.pca_projection

        # Figure out the total weight of the jobs
        job_weight = sum(j[1] for j in job_queue)
        progress_done = total_weight - job_weight
        for job, job_weight in job_queue:

            def _progress_callback(val):
                state.set_progress_value(
                    (progress_done + val * job_weight) / total_weight * 100
                )

            if state.is_interruption_requested():
                return task

            # Execute the job
            job(progress_callback=_progress_callback)
            # Update the progress bar according to the weights assigned to
            # each job
            progress_done += job_weight
            state.set_progress_value(progress_done / total_weight * 100)

        return task


class OWtSNEGraph(OWScatterPlotBase):
    def update_coordinates(self):
        super().update_coordinates()
        if self.scatterplot_item is not None:
            self.view_box.setAspectLocked(True, 1)


class invalidated:
    # pylint: disable=invalid-name
    normalized_data = pca_projection = affinities = tsne_embedding = False

    def __set__(self, instance, value):
        # `self._invalidate = True` should invalidate everything
        self.normalized_data = value
        self.pca_projection = value
        self.affinities = value
        self.tsne_embedding = value

    def __bool__(self):
        # If any of the values are invalidated, this should return true
        return (
            self.normalized_data or self.pca_projection or self.affinities or
            self.tsne_embedding
        )

    def __str__(self):
        return "%s(%s)" % (self.__class__.__name__, ", ".join(
            "=".join([k, str(getattr(self, k))])
            for k in ["normalized_data", "pca_projection", "affinities",
                      "tsne_embedding"]
        ))


class OWtSNE(OWDataProjectionWidget, ConcurrentWidgetMixin):
    name = "t-SNE"
    description = "Two-dimensional data projection with t-SNE."
    icon = "icons/TSNE.svg"
    priority = 920
    keywords = "t-sne, tsne"

    settings_version = 4
    perplexity = ContextSetting(30)
    multiscale = ContextSetting(False)
    exaggeration = ContextSetting(1)

    normalize = ContextSetting(True)
    use_pca_preprocessing = ContextSetting(True)
    pca_components = ContextSetting(_DEFAULT_PCA_COMPONENTS)

    GRAPH_CLASS = OWtSNEGraph
    graph = SettingProvider(OWtSNEGraph)
    embedding_variables_names = ("t-SNE-x", "t-SNE-y")

    # Use `invalidated` descriptor, so we don't break the usage of
    # `_invalidated` in `OWDataProjectionWidget`, but still allow finer control
    # over which parts of the embedding to invalidate
    _invalidated = invalidated()

    class Information(OWDataProjectionWidget.Information):
        modified = Msg("The parameter settings have been changed. Press "
                       "\"Start\" to rerun with the new settings.")

    class Error(OWDataProjectionWidget.Error):
        not_enough_rows = Msg("Input data needs at least 2 rows")
        not_enough_cols = Msg("Input data needs at least 2 attributes")
        constant_data = Msg("Input data is constant")
        no_valid_data = Msg("No projection due to no valid data")

    def __init__(self):
        OWDataProjectionWidget.__init__(self)
        ConcurrentWidgetMixin.__init__(self)
        # Intermediate results
        self.normalized_data = None       # type: Optional[Table]
        self.pca_projection = None        # type: Optional[Table]
        self.initialization = None        # type: Optional[np.ndarray]
        self.affinities = None            # type: Optional[openTSNE.affinity.Affinities]
        self.tsne_embedding = None        # type: Optional[manifold.TSNEModel]
        self.iterations_done = 0          # type: int

    @property
    def effective_data(self):
        return self.data.transform(Domain(self.effective_variables))

    def _add_controls(self):
        self._add_controls_start_box()
        super()._add_controls()

    def _add_controls_start_box(self):
        preprocessing_box = gui.vBox(self.controlArea, box="Preprocessing")
        self.normalize_cbx = gui.checkBox(
            preprocessing_box, self, "normalize", "Normalize data",
            callback=self._invalidate_normalized_data,
        )
        self.pca_preprocessing_cbx = gui.checkBox(
            preprocessing_box, self, "use_pca_preprocessing", "Preprocess using PCA",
            callback=self._pca_preprocessing_changed,
        )
        self.pca_component_slider = gui.hSlider(
            preprocessing_box, self, "pca_components", label="PCA Components:",
            minValue=2, maxValue=_MAX_PCA_COMPONENTS, step=1,
            callback=self._invalidate_pca_projection,
        )

        box = gui.vBox(self.controlArea, box="Parameters")
        form = QFormLayout(
            labelAlignment=Qt.AlignLeft,
            formAlignment=Qt.AlignLeft,
            fieldGrowthPolicy=QFormLayout.AllNonFixedFieldsGrow,
        )

        self.perplexity_spin = gui.spin(
            box, self, "perplexity", 1, 500, step=1, alignment=Qt.AlignRight,
            callback=self._invalidate_affinities, addToLayout=False
        )
        self.controls.perplexity.setDisabled(self.multiscale)
        form.addRow("Perplexity:", self.perplexity_spin)
        form.addRow(gui.checkBox(
            box, self, "multiscale", label="Preserve global structure",
            callback=self._multiscale_changed, addToLayout=False
        ))

        sbe = gui.hBox(self.controlArea, False, addToLayout=False)
        gui.hSlider(
            sbe, self, "exaggeration", minValue=1, maxValue=4, step=1,
            callback=self._invalidate_tsne_embedding,
        )
        form.addRow("Exaggeration:", sbe)

        box.layout().addLayout(form)

        self.run_button = gui.button(box, self, "Start", callback=self._toggle_run)

    # Control callbacks
    def _normalize_data_changed(self):
        self._invalidate_normalized_data()

    def _pca_preprocessing_changed(self):
        self.controls.pca_components.setEnabled(self.use_pca_preprocessing)
        self._invalidate_pca_projection()

    def _multiscale_changed(self):
        self.controls.perplexity.setDisabled(self.multiscale)
        self._invalidate_affinities()

    # Invalidateion cascade
    def _invalidate_normalized_data(self):
        self._invalidated.normalized_data = True
        self._invalidate_pca_projection()

    def _invalidate_pca_projection(self):
        self._invalidated.pca_projection = True
        self._invalidate_affinities()

    def _invalidate_affinities(self):
        self._invalidated.affinities = True
        self._invalidate_tsne_embedding()

    def _invalidate_tsne_embedding(self):
        self._invalidated.tsne_embedding = True
        self._stop_running_task()
        self._set_modified(True)

    def _stop_running_task(self):
        self.cancel()
        self.run_button.setText("Start")

    def _set_modified(self, state):
        """Mark the widget (GUI) as containing modified state."""
        if self.data is None:
            # Does not apply when we have no data
            state = False
        self.Information.modified(shown=state)

    def check_data(self):
        def error(err):
            err()
            self.data = None

        # `super().check_data()` clears all messages, so we have to remember if
        # it was shown
        # pylint: disable=assignment-from-no-return
        should_show_modified_message = self.Information.modified.is_shown()
        super().check_data()

        if self.data is None:
            return

        self.Information.modified(shown=should_show_modified_message)

        if len(self.data) < 2:
            error(self.Error.not_enough_rows)

        elif len(self.data.domain.attributes) < 2:
            error(self.Error.not_enough_cols)

        elif not self.data.is_sparse():
            if np.all(~np.isfinite(self.data.X)):
                error(self.Error.no_valid_data)
            else:
                with warnings.catch_warnings():
                    warnings.filterwarnings(
                        "ignore", "Degrees of freedom .*", RuntimeWarning)
                    if np.nan_to_num(np.nanstd(self.data.X, axis=0)).sum() \
                            == 0:
                        error(self.Error.constant_data)

    def get_embedding(self):
        if self.tsne_embedding is None:
            self.valid_data = None
            return None

        embedding = self.tsne_embedding.embedding.X
        self.valid_data = np.ones(len(embedding), dtype=bool)
        return embedding

    def _toggle_run(self):
        # If no data, there's nothing to do
        if self.data is None:
            return

        # Pause task
        if self.task is not None:
            self.cancel()
            self.run_button.setText("Resume")
            self.commit.deferred()
        # Resume task
        else:
            self.run()

    def handleNewSignals(self):
        # We don't bother with the granular invalidation flags because
        # `super().handleNewSignals` will just set all of them to False or will
        # do nothing. However, it's important we remember its state because we
        # won't call `run` if needed. `run` also relies on the state of
        # `_invalidated` to properly set the intermediate values to None
        prev_invalidated = bool(self._invalidated)
        super().handleNewSignals()
        self._invalidated = prev_invalidated

        if self._invalidated:
            self.run()

    def init_attr_values(self):
        super().init_attr_values()

        if self.data is not None:
            n_attrs = len(self.data.domain.attributes)
            max_components = min(_MAX_PCA_COMPONENTS, n_attrs)
        else:
            max_components = _MAX_PCA_COMPONENTS

        # We set this to the default number of components here so it resets
        # properly, any previous settings will be restored from context
        # settings a little later
        self.controls.pca_components.setMaximum(max_components)
        self.controls.pca_components.setValue(_DEFAULT_PCA_COMPONENTS)

        self.exaggeration = 1

    def enable_controls(self):
        super().enable_controls()

        if self.data is not None:
            # PCA doesn't support normalization on sparse data, as this would
            # require centering and normalizing the matrix
            self.normalize_cbx.setDisabled(self.data.is_sparse())
            if self.data.is_sparse():
                self.normalize = False
                self.normalize_cbx.setToolTip(
                    "Data normalization is not supported on sparse matrices."
                )
            else:
                self.normalize_cbx.setToolTip("")

        # Disable the perplexity spin box if multiscale is turned on
        self.controls.perplexity.setDisabled(self.multiscale)

    def run(self):
        # Reset invalidated values as indicated by the flags
        if self._invalidated.pca_projection:
            self.pca_projection = None
        if self._invalidated.affinities:
            self.affinities = None
        if self._invalidated.tsne_embedding:
            self.iterations_done = 0
            self.tsne_embedding = None

        self._set_modified(False)
        self._invalidated = False

        # When the data is invalid, it is set to `None` and an error is set,
        # therefore it would be erroneous to clear the error here
        if self.data is not None:
            self.run_button.setText("Stop")

        # Cancel current running task
        self.cancel()

        if self.data is None:
            return

        task = Task(
            data=self.data,
            # Normalization
            normalize=self.normalize,
            normalized_data=self.normalized_data,
            # PCA preprocessing
            use_pca_preprocessing=self.use_pca_preprocessing,
            pca_components=self.pca_components,
            pca_projection=self.pca_projection,
            # t-SNE parameters
            perplexity=self.perplexity,
            multiscale=self.multiscale,
            exaggeration=self.exaggeration,
            initialization=self.initialization,
            affinities=self.affinities,
            # Misc
            tsne_embedding=self.tsne_embedding,
            iterations_done=self.iterations_done,
        )
        return self.start(TSNERunner.run, task)

    def __ensure_task_same_for_normalization(self, task: Task):
        assert self.data is not None
        assert task.normalize == self.normalize
        if task.normalize:
            assert isinstance(task.normalized_data, Table) and \
                len(task.normalized_data) == len(self.data)

    def __ensure_task_same_for_pca(self, task: Task):
        assert self.data is not None
        assert task.use_pca_preprocessing == self.use_pca_preprocessing
        if task.use_pca_preprocessing:
            assert task.pca_components == self.pca_components
            assert isinstance(task.pca_projection, Table) and \
                len(task.pca_projection) == len(self.data)

    def __ensure_task_same_for_initialization(self, task: Task):
        assert isinstance(task.initialization, np.ndarray) and \
            len(task.initialization) == len(self.data)

    def __ensure_task_same_for_affinities(self, task: Task):
        assert task.perplexity == self.perplexity
        assert task.multiscale == self.multiscale

    def __ensure_task_same_for_embedding(self, task: Task):
        assert task.exaggeration == self.exaggeration
        assert isinstance(task.tsne_embedding, manifold.TSNEModel) and \
            len(task.tsne_embedding.embedding) == len(self.data)

    def on_partial_result(self, value):
        # type: (Tuple[str, Task]) -> None
        which, task = value

        if which == "normalized_data":
            self.__ensure_task_same_for_normalization(task)
            self.normalized_data = task.normalized_data
        elif which == "pca_projection":
            self.__ensure_task_same_for_normalization(task)
            self.__ensure_task_same_for_pca(task)
            self.pca_projection = task.pca_projection
        elif which == "initialization":
            self.__ensure_task_same_for_normalization(task)
            self.__ensure_task_same_for_pca(task)
            self.__ensure_task_same_for_initialization(task)
            self.initialization = task.initialization
        elif which == "affinities":
            self.__ensure_task_same_for_normalization(task)
            self.__ensure_task_same_for_pca(task)
            self.__ensure_task_same_for_affinities(task)
            self.affinities = task.affinities
        elif which == "tsne_embedding":
            self.__ensure_task_same_for_normalization(task)
            self.__ensure_task_same_for_pca(task)
            self.__ensure_task_same_for_initialization(task)
            self.__ensure_task_same_for_affinities(task)
            self.__ensure_task_same_for_embedding(task)

            prev_embedding, self.tsne_embedding = self.tsne_embedding, task.tsne_embedding
            self.iterations_done = task.iterations_done
            # If this is the first partial result we've gotten, we've got to
            # setup the plot
            if prev_embedding is None:
                self.setup_plot()
            # Otherwise, just update the point positions
            else:
                self.graph.update_coordinates()
                self.graph.update_density()
        else:
            raise RuntimeError(
                "Unrecognized partial result called with `%s`" % which
            )

    def on_done(self, task):
        # type: (Task) -> None
        self.run_button.setText("Start")
        # NOTE: All of these have already been set by on_partial_result,
        # we double check that they are aliases
        if task.pca_projection is not None:
            self.__ensure_task_same_for_pca(task)
            assert task.pca_projection is self.pca_projection
        if task.initialization is not None:
            self.__ensure_task_same_for_initialization(task)
            assert task.initialization is self.initialization
        if task.affinities is not None:
            assert task.affinities is self.affinities
        if task.tsne_embedding is not None:
            self.__ensure_task_same_for_embedding(task)
            assert task.tsne_embedding is self.tsne_embedding

        self.commit.deferred()

    def _get_projection_data(self):
        if self.data is None:
            return None

        data = self.data.transform(
            Domain(
                self.data.domain.attributes,
                self.data.domain.class_vars,
                self.data.domain.metas + self._get_projection_variables()
            )
        )
        with data.unlocked(data.metas):
            data.metas[:, -2:] = self.get_embedding()
        if self.tsne_embedding is not None:
            data.domain = Domain(
                self.data.domain.attributes,
                self.data.domain.class_vars,
                self.data.domain.metas + self.tsne_embedding.domain.attributes,
            )
        return data

    def clear(self):
        """Clear widget state. Note that this doesn't clear the data."""
        super().clear()
        self.run_button.setText("Start")
        self.cancel()
        self.normalized_data = None
        self.pca_projection = None
        self.initialization = None
        self.affinities = None
        self.tsne_embedding = None
        self.iterations_done = 0

    def onDeleteWidget(self):
        self.clear()
        self.data = None
        self.shutdown()
        super().onDeleteWidget()

    @classmethod
    def migrate_settings(cls, settings, version):
        if version < 3:
            if "selection_indices" in settings:
                settings["selection"] = settings["selection_indices"]
        if version < 4:
            settings.pop("max_iter", None)

    @classmethod
    def migrate_context(cls, context, version):
        if version < 3:
            values = context.values
            values["attr_color"] = values["graph"]["attr_color"]
            values["attr_size"] = values["graph"]["attr_size"]
            values["attr_shape"] = values["graph"]["attr_shape"]
            values["attr_label"] = values["graph"]["attr_label"]


if __name__ == "__main__":
    import sys
    data = Table(sys.argv[1] if len(sys.argv) > 1 else "iris")
    WidgetPreview(OWtSNE).run(
        set_data=data,
        set_subset_data=data[np.random.choice(len(data), 10)],
    )

```
--- END FILE ---

Please first localize the bug based on the issue statement, and then generate *SEARCH/REPLACE* edits to fix the issue.

Every *SEARCH/REPLACE* edit must use this format:
1. The file path
2. The start of search block: <<<<<<< SEARCH
3. A contiguous chunk of lines to search for in the existing source code
4. The dividing line: =======
5. The lines to replace into the source code
6. The end of the replace block: >>>>>>> REPLACE

Here is an example:

```python
### mathweb/flask/app.py
<<<<<<< SEARCH
from flask import Flask
=======
import math
from flask import Flask
>>>>>>> REPLACE
```
</solution>

Please note that the *SEARCH/REPLACE* edit REQUIRES PROPER INDENTATION. If you would like to add the line '        print(x)', you must fully write that out, with all those spaces before the code!
Wrap each *SEARCH/REPLACE* edit in a code block as shown in the example above. If you have multiple *SEARCH/REPLACE* edits, use a separate code block for each one.
**Analysis:**

- **Key Parts from Commit Details:**
  - **Commit Message:** `owtsne: Warn if PCA disabled and large number of features.`
  - **Change:** Added a warning message when PCA preprocessing is disabled and the input data has a large number of features.
  - **Test Results:** Previously, the test `test_pca_preprocessing_warning_with_large_number_of_features` failed with an `AttributeError` because the warning was not implemented.

- **Main Problem Highlighted by Test Results:**
  - The widget is expected to display a warning when PCA preprocessing is disabled and the dataset has a large number of features. However, before the commit, this warning was not present, causing the test to fail.

- **Expected Behavior:**
  - When PCA preprocessing is disabled and the dataset contains many features, the widget should display a warning advising the user to enable PCA preprocessing to improve performance.

- **Actual Behavior or Error Message:**
  - The warning is not displayed, leading to potential performance issues without user awareness.

- **Issue Description:**
  - The issue should clearly state that the widget fails to display a necessary warning under specific conditions, providing details on how to reproduce the problem and what the expected outcome should be.

---

[ISSUE]
**Title:** Missing Warning When PCA Preprocessing is Disabled with High-Dimensional Data

**Description:**

When PCA preprocessing is turned off in the t-SNE widget and the input dataset contains a large number of features, the widget does not display a warning. This omission can lead to unexpected slowdowns during computation without informing the user of the potential performance impact.

**Steps to Reproduce:**

1. Open the t-SNE widget in the application.
2. Disable the PCA preprocessing option.
3. Input a dataset with a high number of features (e.g., 250 features).
4. Run the t-SNE computation.

**Expected Behavior:**

A warning message should appear indicating that the input data has a large number of features and recommending enabling PCA preprocessing to enhance computation speed.

**Actual Behavior:**

No warning is displayed, leaving users unaware that disabling PCA preprocessing with high-dimensional data may result in slower performance.

**Example Code Snippet:**

```python
# Example setup in the widget
widget.controls.use_pca_preprocessing.setChecked(False)
data_large = Table.from_numpy(Domain.from_numpy(np.random.normal(0, 1, size=(50, 250))), np.random.normal(0, 1, size=(50, 250)))
widget.send_signal(widget.Inputs.data, data_large)
widget.run_button.click()
# Expected: Warning.consider_using_pca_preprocessing is_shown()
# Actual: AttributeError or no warning displayed
```
[/ISSUE]
{
    "TestOWtSNE.test_attr_label_metas": "PASSED",
    "TestOWtSNE.test_attr_models": "PASSED",
    "TestOWtSNE.test_class_density": "PASSED",
    "TestOWtSNE.test_datasets": "PASSED",
    "TestOWtSNE.test_default_attrs": "PASSED",
    "TestOWtSNE.test_dragging_tooltip": "PASSED",
    "TestOWtSNE.test_exaggeration_is_passed_through_properly": "PASSED",
    "TestOWtSNE.test_handle_primitive_metas": "PASSED",
    "TestOWtSNE.test_hidden_effective_variables": "PASSED",
    "TestOWtSNE.test_image_export": "PASSED",
    "TestOWtSNE.test_input": "PASSED",
    "TestOWtSNE.test_invalidated_embedding": "PASSED",
    "TestOWtSNE.test_invalidation_flow": "PASSED",
    "TestOWtSNE.test_minimum_size": "PASSED",
    "TestOWtSNE.test_modified_info_message_behaviour": "PASSED",
    "TestOWtSNE.test_msg_base_class": "PASSED",
    "TestOWtSNE.test_multiscale_changed_updates_ui": "PASSED",
    "TestOWtSNE.test_none_data": "PASSED",
    "TestOWtSNE.test_normalize_data": "PASSED",
    "TestOWtSNE.test_outputs": "PASSED",
    "TestOWtSNE.test_pca_preprocessing_warning_with_large_number_of_features": "PASSED",
    "TestOWtSNE.test_plot_once": "PASSED",
    "TestOWtSNE.test_saved_selection": "PASSED",
    "TestOWtSNE.test_send_report": "PASSED",
    "TestOWtSNE.test_setup_graph": "PASSED",
    "TestOWtSNE.test_sparse_data": "PASSED",
    "TestOWtSNE.test_subset_data_color": "PASSED",
    "TestOWtSNE.test_visual_settings": "PASSED",
    "TestOWtSNE.test_wrong_input": "PASSED",
    "TestTSNERunner.test_run_do_not_modify_model_inplace": "PASSED",
    "TestTSNERunner.test_run_with_normalization": "PASSED",
    "TestTSNERunner.test_run_with_normalization_and_pca_preprocessing": "PASSED",
    "TestTSNERunner.test_run_with_pca_preprocessing": "PASSED"
}
diff --git a/Orange/widgets/unsupervised/owtsne.py b/Orange/widgets/unsupervised/owtsne.py
index ef9f3c31e..5bb8777ea 100644
--- a/Orange/widgets/unsupervised/owtsne.py
+++ b/Orange/widgets/unsupervised/owtsne.py
@@ -305,6 +305,12 @@ class OWtSNE(OWDataProjectionWidget, ConcurrentWidgetMixin):
         modified = Msg("The parameter settings have been changed. Press "
                        "\"Start\" to rerun with the new settings.")
 
+    class Warning(OWDataProjectionWidget.Warning):
+        consider_using_pca_preprocessing = Msg(
+            "The input data contains a large number of features, which may slow"
+            " down t-SNE computation. Consider enabling PCA preprocessing."
+        )
+
     class Error(OWDataProjectionWidget.Error):
         not_enough_rows = Msg("Input data needs at least 2 rows")
         not_enough_cols = Msg("Input data needs at least 2 attributes")
@@ -383,6 +389,12 @@ class OWtSNE(OWDataProjectionWidget, ConcurrentWidgetMixin):
         self.controls.pca_components.setEnabled(self.use_pca_preprocessing)
         self._invalidate_pca_projection()
 
+        should_warn_pca = False
+        if self.data is not None and not self.use_pca_preprocessing:
+            if len(self.data.domain.attributes) >= _MAX_PCA_COMPONENTS:
+                should_warn_pca = True
+        self.Warning.consider_using_pca_preprocessing(shown=should_warn_pca)
+
     def _multiscale_changed(self):
         self.controls.perplexity.setDisabled(self.multiscale)
         self._invalidate_affinities()

{"Orange/widgets/unsupervised/owtsne.py": "import warnings\nfrom functools import partial\nfrom types import SimpleNamespace as namespace\nfrom typing import Optional  # pylint: disable=unused-import\n\nimport numpy as np\n\nfrom AnyQt.QtCore import Qt\nfrom AnyQt.QtWidgets import QFormLayout\n\nfrom Orange.data import Table, Domain\nfrom Orange.preprocess import preprocess\nfrom Orange.projection import PCA\nfrom Orange.projection import manifold\nfrom Orange.widgets import gui\nfrom Orange.widgets.settings import SettingProvider, ContextSetting\nfrom Orange.widgets.utils.concurrent import TaskState, ConcurrentWidgetMixin\nfrom Orange.widgets.utils.widgetpreview import WidgetPreview\nfrom Orange.widgets.visualize.owscatterplotgraph import OWScatterPlotBase\nfrom Orange.widgets.visualize.utils.widget import OWDataProjectionWidget\nfrom Orange.widgets.widget import Msg\n\n_STEP_SIZE = 25\n_MAX_PCA_COMPONENTS = 50\n_DEFAULT_PCA_COMPONENTS = 20\n\n\nclass Task(namespace):\n    \"\"\"Completely determines the t-SNE task spec and intermediate results.\"\"\"\n    data = None                     # type: Optional[Table]\n\n    normalize = None                # type: Optional[bool]\n    normalized_data = None          # type: Optional[Table]\n\n    use_pca_preprocessing = None    # type: Optional[bool]\n    pca_components = None           # type: Optional[int]\n    pca_projection = None           # type: Optional[Table]\n\n    perplexity = None               # type: Optional[float]\n    multiscale = None               # type: Optional[bool]\n    exaggeration = None             # type: Optional[float]\n    initialization = None           # type: Optional[np.ndarray]\n    affinities = None               # type: Optional[openTSNE.affinity.Affinities]\n    tsne_embedding = None           # type: Optional[manifold.TSNEModel]\n    iterations_done = 0             # type: int\n\n    # These attributes need not be set by the widget\n    tsne = None                     # type: Optional[manifold.TSNE]\n    # `effective_data` stores the current working matrix which should be used\n    # for any steps depending on the data matrix. For instance, normalization\n    # should use the effective data (presumably the original data), and set it\n    # to the normalized version upon completion. This can then later be used for\n    # PCA preprocessing\n    effective_data = None           # type: Optional[Table]\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        # Set `effective_data` to data if data provided, and effective data\n        # not provided\n        if self.effective_data is None and self.data is not None:\n            self.effective_data = self.data\n\n\ndef data_normalization(data):\n    normalization = preprocess.Normalize()\n    return normalization(data)\n\n\ndef pca_preprocessing(data, n_components):\n    projector = PCA(n_components=n_components, random_state=0)\n    model = projector(data)\n    return model(data)\n\n\ndef prepare_tsne_obj(data, perplexity, multiscale, exaggeration):\n    # type: (Table, float, bool, float) -> manifold.TSNE\n    \"\"\"Automatically determine the best parameters for the given data set.\"\"\"\n    # Compute perplexity settings for multiscale\n    n_samples = data.X.shape[0]\n    if multiscale:\n        perplexity = min((n_samples - 1) / 3, 50), min((n_samples - 1) / 3, 500)\n    else:\n        perplexity = perplexity\n\n    return manifold.TSNE(\n        n_components=2,\n        perplexity=perplexity,\n        multiscale=multiscale,\n        exaggeration=exaggeration,\n        random_state=0,\n    )\n\n\nclass TSNERunner:\n    @staticmethod\n    def compute_normalization(task: Task, state: TaskState, **_) -> None:\n        state.set_status(\"Normalizing data...\")\n        task.normalized_data = data_normalization(task.effective_data)\n        task.effective_data = task.normalized_data\n        state.set_partial_result((\"normalized_data\", task))\n\n    @staticmethod\n    def compute_pca(task: Task, state: TaskState, **_) -> None:\n        # Perform PCA preprocessing\n        state.set_status(\"Computing PCA...\")\n        pca_projection = pca_preprocessing(task.effective_data, task.pca_components)\n        # Apply t-SNE's preprocessors to the data\n        task.pca_projection = task.tsne.preprocess(pca_projection)\n        task.effective_data = task.pca_projection\n        state.set_partial_result((\"pca_projection\", task))\n\n    @staticmethod\n    def compute_initialization(task: Task, state: TaskState, **_) -> None:\n        # Prepare initial positions for t-SNE\n        state.set_status(\"Preparing initialization...\")\n        task.initialization = task.tsne.compute_initialization(task.effective_data.X)\n        state.set_partial_result((\"initialization\", task))\n\n    @staticmethod\n    def compute_affinities(task: Task, state: TaskState, **_) -> None:\n        # Compute affinities\n        state.set_status(\"Finding nearest neighbors...\")\n        task.affinities = task.tsne.compute_affinities(task.effective_data.X)\n        state.set_partial_result((\"affinities\", task))\n\n    @staticmethod\n    def compute_tsne(task: Task, state: TaskState, progress_callback=None) -> None:\n        tsne = task.tsne\n\n        state.set_status(\"Running optimization...\")\n\n        # If this the first time we're computing t-SNE (otherwise we may just\n        # be resuming optimization), we have to assemble the tsne object\n        if task.tsne_embedding is None:\n            # Assemble a t-SNE embedding object and convert it to a TSNEModel\n            task.tsne_embedding = tsne.prepare_embedding(\n                task.affinities, task.initialization\n            )\n            task.tsne_embedding = tsne.convert_embedding_to_model(\n                task.effective_data, task.tsne_embedding\n            )\n            state.set_partial_result((\"tsne_embedding\", task))\n\n            if state.is_interruption_requested():\n                return\n\n        total_iterations_needed = tsne.early_exaggeration_iter + tsne.n_iter\n\n        def run_optimization(tsne_params: dict, iterations_needed: int) -> bool:\n            \"\"\"Run t-SNE optimization phase. Return value indicates whether the\n            optimization was interrupted.\"\"\"\n            while task.iterations_done < iterations_needed:\n                # Step size can't be larger than the remaining number of iterations\n                step_size = min(_STEP_SIZE, iterations_needed - task.iterations_done)\n                task.tsne_embedding = task.tsne_embedding.optimize(\n                    step_size, **tsne_params\n                )\n                task.iterations_done += step_size\n                state.set_partial_result((\"tsne_embedding\", task))\n                if progress_callback is not None:\n                    # The current iterations must be divided by the total\n                    # number of iterations, not the number of iterations in the\n                    # current phase (iterations_needed)\n                    progress_callback(task.iterations_done / total_iterations_needed)\n\n                if state.is_interruption_requested():\n                    return True\n\n        # Run early exaggeration phase\n        was_interrupted = run_optimization(\n            dict(exaggeration=tsne.early_exaggeration, momentum=0.8, inplace=False),\n            iterations_needed=tsne.early_exaggeration_iter,\n        )\n        if was_interrupted:\n            return\n        # Run regular optimization phase\n        run_optimization(\n            dict(exaggeration=tsne.exaggeration, momentum=0.8, inplace=False),\n            iterations_needed=total_iterations_needed,\n        )\n\n    @classmethod\n    def run(cls, task: Task, state: TaskState) -> Task:\n        # Assign weights to each job indicating how much time will be spent on each\n        weights = {\"normalization\": 1, \"pca\": 1, \"init\": 1, \"aff\": 25, \"tsne\": 50}\n        total_weight = sum(weights.values())\n\n        # Prepare the tsne object and add it to the spec\n        task.tsne = prepare_tsne_obj(\n            task.data, task.perplexity, task.multiscale, task.exaggeration\n        )\n\n        job_queue = []\n        # Add the tasks that still need to be run to the job queue\n        task.effective_data = task.data\n\n        if task.normalize and task.normalized_data is None:\n            job_queue.append((cls.compute_normalization, weights[\"normalization\"]))\n\n        if task.use_pca_preprocessing and task.pca_projection is None:\n            job_queue.append((cls.compute_pca, weights[\"pca\"]))\n\n        if task.initialization is None:\n            job_queue.append((cls.compute_initialization, weights[\"init\"]))\n\n        if task.affinities is None:\n            job_queue.append((cls.compute_affinities, weights[\"aff\"]))\n\n        total_iterations = task.tsne.early_exaggeration_iter + task.tsne.n_iter\n        if task.tsne_embedding is None or task.iterations_done < total_iterations:\n            job_queue.append((cls.compute_tsne, weights[\"tsne\"]))\n\n        job_queue = [(partial(f, task, state), w) for f, w in job_queue]\n\n        # Ensure the effective data is set to the appropriate, potentially\n        # precomputed matrix\n        task.effective_data = task.data\n        if task.normalize and task.normalized_data is not None:\n            task.effective_data = task.normalized_data\n        if task.use_pca_preprocessing and task.pca_projection is not None:\n            task.effective_data = task.pca_projection\n\n        # Figure out the total weight of the jobs\n        job_weight = sum(j[1] for j in job_queue)\n        progress_done = total_weight - job_weight\n        for job, job_weight in job_queue:\n\n            def _progress_callback(val):\n                state.set_progress_value(\n                    (progress_done + val * job_weight) / total_weight * 100\n                )\n\n            if state.is_interruption_requested():\n                return task\n\n            # Execute the job\n            job(progress_callback=_progress_callback)\n            # Update the progress bar according to the weights assigned to\n            # each job\n            progress_done += job_weight\n            state.set_progress_value(progress_done / total_weight * 100)\n\n        return task\n\n\nclass OWtSNEGraph(OWScatterPlotBase):\n    def update_coordinates(self):\n        super().update_coordinates()\n        if self.scatterplot_item is not None:\n            self.view_box.setAspectLocked(True, 1)\n\n\nclass invalidated:\n    # pylint: disable=invalid-name\n    normalized_data = pca_projection = affinities = tsne_embedding = False\n\n    def __set__(self, instance, value):\n        # `self._invalidate = True` should invalidate everything\n        self.normalized_data = value\n        self.pca_projection = value\n        self.affinities = value\n        self.tsne_embedding = value\n\n    def __bool__(self):\n        # If any of the values are invalidated, this should return true\n        return (\n            self.normalized_data or self.pca_projection or self.affinities or\n            self.tsne_embedding\n        )\n\n    def __str__(self):\n        return \"%s(%s)\" % (self.__class__.__name__, \", \".join(\n            \"=\".join([k, str(getattr(self, k))])\n            for k in [\"normalized_data\", \"pca_projection\", \"affinities\",\n                      \"tsne_embedding\"]\n        ))\n\n\nclass OWtSNE(OWDataProjectionWidget, ConcurrentWidgetMixin):\n    name = \"t-SNE\"\n    description = \"Two-dimensional data projection with t-SNE.\"\n    icon = \"icons/TSNE.svg\"\n    priority = 920\n    keywords = \"t-sne, tsne\"\n\n    settings_version = 4\n    perplexity = ContextSetting(30)\n    multiscale = ContextSetting(False)\n    exaggeration = ContextSetting(1)\n\n    normalize = ContextSetting(True)\n    use_pca_preprocessing = ContextSetting(True)\n    pca_components = ContextSetting(_DEFAULT_PCA_COMPONENTS)\n\n    GRAPH_CLASS = OWtSNEGraph\n    graph = SettingProvider(OWtSNEGraph)\n    embedding_variables_names = (\"t-SNE-x\", \"t-SNE-y\")\n\n    # Use `invalidated` descriptor, so we don't break the usage of\n    # `_invalidated` in `OWDataProjectionWidget`, but still allow finer control\n    # over which parts of the embedding to invalidate\n    _invalidated = invalidated()\n\n    class Information(OWDataProjectionWidget.Information):\n        modified = Msg(\"The parameter settings have been changed. Press \"\n                       \"\\\"Start\\\" to rerun with the new settings.\")\n\n    class Error(OWDataProjectionWidget.Error):\n        not_enough_rows = Msg(\"Input data needs at least 2 rows\")\n        not_enough_cols = Msg(\"Input data needs at least 2 attributes\")\n        constant_data = Msg(\"Input data is constant\")\n        no_valid_data = Msg(\"No projection due to no valid data\")\n\n    def __init__(self):\n        OWDataProjectionWidget.__init__(self)\n        ConcurrentWidgetMixin.__init__(self)\n        # Intermediate results\n        self.normalized_data = None       # type: Optional[Table]\n        self.pca_projection = None        # type: Optional[Table]\n        self.initialization = None        # type: Optional[np.ndarray]\n        self.affinities = None            # type: Optional[openTSNE.affinity.Affinities]\n        self.tsne_embedding = None        # type: Optional[manifold.TSNEModel]\n        self.iterations_done = 0          # type: int\n\n    @property\n    def effective_data(self):\n        return self.data.transform(Domain(self.effective_variables))\n\n    def _add_controls(self):\n        self._add_controls_start_box()\n        super()._add_controls()\n\n    def _add_controls_start_box(self):\n        preprocessing_box = gui.vBox(self.controlArea, box=\"Preprocessing\")\n        self.normalize_cbx = gui.checkBox(\n            preprocessing_box, self, \"normalize\", \"Normalize data\",\n            callback=self._invalidate_normalized_data,\n        )\n        self.pca_preprocessing_cbx = gui.checkBox(\n            preprocessing_box, self, \"use_pca_preprocessing\", \"Preprocess using PCA\",\n            callback=self._pca_preprocessing_changed,\n        )\n        self.pca_component_slider = gui.hSlider(\n            preprocessing_box, self, \"pca_components\", label=\"PCA Components:\",\n            minValue=2, maxValue=_MAX_PCA_COMPONENTS, step=1,\n            callback=self._invalidate_pca_projection,\n        )\n\n        box = gui.vBox(self.controlArea, box=\"Parameters\")\n        form = QFormLayout(\n            labelAlignment=Qt.AlignLeft,\n            formAlignment=Qt.AlignLeft,\n            fieldGrowthPolicy=QFormLayout.AllNonFixedFieldsGrow,\n        )\n\n        self.perplexity_spin = gui.spin(\n            box, self, \"perplexity\", 1, 500, step=1, alignment=Qt.AlignRight,\n            callback=self._invalidate_affinities, addToLayout=False\n        )\n        self.controls.perplexity.setDisabled(self.multiscale)\n        form.addRow(\"Perplexity:\", self.perplexity_spin)\n        form.addRow(gui.checkBox(\n            box, self, \"multiscale\", label=\"Preserve global structure\",\n            callback=self._multiscale_changed, addToLayout=False\n        ))\n\n        sbe = gui.hBox(self.controlArea, False, addToLayout=False)\n        gui.hSlider(\n            sbe, self, \"exaggeration\", minValue=1, maxValue=4, step=1,\n            callback=self._invalidate_tsne_embedding,\n        )\n        form.addRow(\"Exaggeration:\", sbe)\n\n        box.layout().addLayout(form)\n\n        self.run_button = gui.button(box, self, \"Start\", callback=self._toggle_run)\n\n    # Control callbacks\n    def _normalize_data_changed(self):\n        self._invalidate_normalized_data()\n\n    def _pca_preprocessing_changed(self):\n        self.controls.pca_components.setEnabled(self.use_pca_preprocessing)\n        self._invalidate_pca_projection()\n\n    def _multiscale_changed(self):\n        self.controls.perplexity.setDisabled(self.multiscale)\n        self._invalidate_affinities()\n\n    # Invalidateion cascade\n    def _invalidate_normalized_data(self):\n        self._invalidated.normalized_data = True\n        self._invalidate_pca_projection()\n\n    def _invalidate_pca_projection(self):\n        self._invalidated.pca_projection = True\n        self._invalidate_affinities()\n\n    def _invalidate_affinities(self):\n        self._invalidated.affinities = True\n        self._invalidate_tsne_embedding()\n\n    def _invalidate_tsne_embedding(self):\n        self._invalidated.tsne_embedding = True\n        self._stop_running_task()\n        self._set_modified(True)\n\n    def _stop_running_task(self):\n        self.cancel()\n        self.run_button.setText(\"Start\")\n\n    def _set_modified(self, state):\n        \"\"\"Mark the widget (GUI) as containing modified state.\"\"\"\n        if self.data is None:\n            # Does not apply when we have no data\n            state = False\n        self.Information.modified(shown=state)\n\n    def check_data(self):\n        def error(err):\n            err()\n            self.data = None\n\n        # `super().check_data()` clears all messages, so we have to remember if\n        # it was shown\n        # pylint: disable=assignment-from-no-return\n        should_show_modified_message = self.Information.modified.is_shown()\n        super().check_data()\n\n        if self.data is None:\n            return\n\n        self.Information.modified(shown=should_show_modified_message)\n\n        if len(self.data) < 2:\n            error(self.Error.not_enough_rows)\n\n        elif len(self.data.domain.attributes) < 2:\n            error(self.Error.not_enough_cols)\n\n        elif not self.data.is_sparse():\n            if np.all(~np.isfinite(self.data.X)):\n                error(self.Error.no_valid_data)\n            else:\n                with warnings.catch_warnings():\n                    warnings.filterwarnings(\n                        \"ignore\", \"Degrees of freedom .*\", RuntimeWarning)\n                    if np.nan_to_num(np.nanstd(self.data.X, axis=0)).sum() \\\n                            == 0:\n                        error(self.Error.constant_data)\n\n    def get_embedding(self):\n        if self.tsne_embedding is None:\n            self.valid_data = None\n            return None\n\n        embedding = self.tsne_embedding.embedding.X\n        self.valid_data = np.ones(len(embedding), dtype=bool)\n        return embedding\n\n    def _toggle_run(self):\n        # If no data, there's nothing to do\n        if self.data is None:\n            return\n\n        # Pause task\n        if self.task is not None:\n            self.cancel()\n            self.run_button.setText(\"Resume\")\n            self.commit.deferred()\n        # Resume task\n        else:\n            self.run()\n\n    def handleNewSignals(self):\n        # We don't bother with the granular invalidation flags because\n        # `super().handleNewSignals` will just set all of them to False or will\n        # do nothing. However, it's important we remember its state because we\n        # won't call `run` if needed. `run` also relies on the state of\n        # `_invalidated` to properly set the intermediate values to None\n        prev_invalidated = bool(self._invalidated)\n        super().handleNewSignals()\n        self._invalidated = prev_invalidated\n\n        if self._invalidated:\n            self.run()\n\n    def init_attr_values(self):\n        super().init_attr_values()\n\n        if self.data is not None:\n            n_attrs = len(self.data.domain.attributes)\n            max_components = min(_MAX_PCA_COMPONENTS, n_attrs)\n        else:\n            max_components = _MAX_PCA_COMPONENTS\n\n        # We set this to the default number of components here so it resets\n        # properly, any previous settings will be restored from context\n        # settings a little later\n        self.controls.pca_components.setMaximum(max_components)\n        self.controls.pca_components.setValue(_DEFAULT_PCA_COMPONENTS)\n\n        self.exaggeration = 1\n\n    def enable_controls(self):\n        super().enable_controls()\n\n        if self.data is not None:\n            # PCA doesn't support normalization on sparse data, as this would\n            # require centering and normalizing the matrix\n            self.normalize_cbx.setDisabled(self.data.is_sparse())\n            if self.data.is_sparse():\n                self.normalize = False\n                self.normalize_cbx.setToolTip(\n                    \"Data normalization is not supported on sparse matrices.\"\n                )\n            else:\n                self.normalize_cbx.setToolTip(\"\")\n\n        # Disable the perplexity spin box if multiscale is turned on\n        self.controls.perplexity.setDisabled(self.multiscale)\n\n    def run(self):\n        # Reset invalidated values as indicated by the flags\n        if self._invalidated.pca_projection:\n            self.pca_projection = None\n        if self._invalidated.affinities:\n            self.affinities = None\n        if self._invalidated.tsne_embedding:\n            self.iterations_done = 0\n            self.tsne_embedding = None\n\n        self._set_modified(False)\n        self._invalidated = False\n\n        # When the data is invalid, it is set to `None` and an error is set,\n        # therefore it would be erroneous to clear the error here\n        if self.data is not None:\n            self.run_button.setText(\"Stop\")\n\n        # Cancel current running task\n        self.cancel()\n\n        if self.data is None:\n            return\n\n        task = Task(\n            data=self.data,\n            # Normalization\n            normalize=self.normalize,\n            normalized_data=self.normalized_data,\n            # PCA preprocessing\n            use_pca_preprocessing=self.use_pca_preprocessing,\n            pca_components=self.pca_components,\n            pca_projection=self.pca_projection,\n            # t-SNE parameters\n            perplexity=self.perplexity,\n            multiscale=self.multiscale,\n            exaggeration=self.exaggeration,\n            initialization=self.initialization,\n            affinities=self.affinities,\n            # Misc\n            tsne_embedding=self.tsne_embedding,\n            iterations_done=self.iterations_done,\n        )\n        return self.start(TSNERunner.run, task)\n\n    def __ensure_task_same_for_normalization(self, task: Task):\n        assert self.data is not None\n        assert task.normalize == self.normalize\n        if task.normalize:\n            assert isinstance(task.normalized_data, Table) and \\\n                len(task.normalized_data) == len(self.data)\n\n    def __ensure_task_same_for_pca(self, task: Task):\n        assert self.data is not None\n        assert task.use_pca_preprocessing == self.use_pca_preprocessing\n        if task.use_pca_preprocessing:\n            assert task.pca_components == self.pca_components\n            assert isinstance(task.pca_projection, Table) and \\\n                len(task.pca_projection) == len(self.data)\n\n    def __ensure_task_same_for_initialization(self, task: Task):\n        assert isinstance(task.initialization, np.ndarray) and \\\n            len(task.initialization) == len(self.data)\n\n    def __ensure_task_same_for_affinities(self, task: Task):\n        assert task.perplexity == self.perplexity\n        assert task.multiscale == self.multiscale\n\n    def __ensure_task_same_for_embedding(self, task: Task):\n        assert task.exaggeration == self.exaggeration\n        assert isinstance(task.tsne_embedding, manifold.TSNEModel) and \\\n            len(task.tsne_embedding.embedding) == len(self.data)\n\n    def on_partial_result(self, value):\n        # type: (Tuple[str, Task]) -> None\n        which, task = value\n\n        if which == \"normalized_data\":\n            self.__ensure_task_same_for_normalization(task)\n            self.normalized_data = task.normalized_data\n        elif which == \"pca_projection\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.pca_projection = task.pca_projection\n        elif which == \"initialization\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_initialization(task)\n            self.initialization = task.initialization\n        elif which == \"affinities\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_affinities(task)\n            self.affinities = task.affinities\n        elif which == \"tsne_embedding\":\n            self.__ensure_task_same_for_normalization(task)\n            self.__ensure_task_same_for_pca(task)\n            self.__ensure_task_same_for_initialization(task)\n            self.__ensure_task_same_for_affinities(task)\n            self.__ensure_task_same_for_embedding(task)\n\n            prev_embedding, self.tsne_embedding = self.tsne_embedding, task.tsne_embedding\n            self.iterations_done = task.iterations_done\n            # If this is the first partial result we've gotten, we've got to\n            # setup the plot\n            if prev_embedding is None:\n                self.setup_plot()\n            # Otherwise, just update the point positions\n            else:\n                self.graph.update_coordinates()\n                self.graph.update_density()\n        else:\n            raise RuntimeError(\n                \"Unrecognized partial result called with `%s`\" % which\n            )\n\n    def on_done(self, task):\n        # type: (Task) -> None\n        self.run_button.setText(\"Start\")\n        # NOTE: All of these have already been set by on_partial_result,\n        # we double check that they are aliases\n        if task.pca_projection is not None:\n            self.__ensure_task_same_for_pca(task)\n            assert task.pca_projection is self.pca_projection\n        if task.initialization is not None:\n            self.__ensure_task_same_for_initialization(task)\n            assert task.initialization is self.initialization\n        if task.affinities is not None:\n            assert task.affinities is self.affinities\n        if task.tsne_embedding is not None:\n            self.__ensure_task_same_for_embedding(task)\n            assert task.tsne_embedding is self.tsne_embedding\n\n        self.commit.deferred()\n\n    def _get_projection_data(self):\n        if self.data is None:\n            return None\n\n        data = self.data.transform(\n            Domain(\n                self.data.domain.attributes,\n                self.data.domain.class_vars,\n                self.data.domain.metas + self._get_projection_variables()\n            )\n        )\n        with data.unlocked(data.metas):\n            data.metas[:, -2:] = self.get_embedding()\n        if self.tsne_embedding is not None:\n            data.domain = Domain(\n                self.data.domain.attributes,\n                self.data.domain.class_vars,\n                self.data.domain.metas + self.tsne_embedding.domain.attributes,\n            )\n        return data\n\n    def clear(self):\n        \"\"\"Clear widget state. Note that this doesn't clear the data.\"\"\"\n        super().clear()\n        self.run_button.setText(\"Start\")\n        self.cancel()\n        self.normalized_data = None\n        self.pca_projection = None\n        self.initialization = None\n        self.affinities = None\n        self.tsne_embedding = None\n        self.iterations_done = 0\n\n    def onDeleteWidget(self):\n        self.clear()\n        self.data = None\n        self.shutdown()\n        super().onDeleteWidget()\n\n    @classmethod\n    def migrate_settings(cls, settings, version):\n        if version < 3:\n            if \"selection_indices\" in settings:\n                settings[\"selection\"] = settings[\"selection_indices\"]\n        if version < 4:\n            settings.pop(\"max_iter\", None)\n\n    @classmethod\n    def migrate_context(cls, context, version):\n        if version < 3:\n            values = context.values\n            values[\"attr_color\"] = values[\"graph\"][\"attr_color\"]\n            values[\"attr_size\"] = values[\"graph\"][\"attr_size\"]\n            values[\"attr_shape\"] = values[\"graph\"][\"attr_shape\"]\n            values[\"attr_label\"] = values[\"graph\"][\"attr_label\"]\n\n\nif __name__ == \"__main__\":\n    import sys\n    data = Table(sys.argv[1] if len(sys.argv) > 1 else \"iris\")\n    WidgetPreview(OWtSNE).run(\n        set_data=data,\n        set_subset_data=data[np.random.choice(len(data), 10)],\n    )\n"}
A user will ask you to solve a task. You should first draft your thinking process (inner monologue). Then, generate the solution.

Your response format must follow the template below:
<think>
Your thoughts or/and draft, like working through an exercise on scratch paper. Be as casual and as long as you want until you are confident to generate a correct solution.
</think>
<solution>
Final solution presented to the user.
</solution>
system
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
**Analysis:**

- **Key Parts from Commit Details:**
  - **Commit Message:** `owtsne: Warn if PCA disabled and large number of features.`
  - **Change:** Added a warning message when PCA preprocessing is disabled and the input data has a large number of features.
  - **Test Results:** Previously, the test `test_pca_preprocessing_warning_with_large_number_of_features` failed with an `AttributeError` because the warning was not implemented.

- **Main Problem Highlighted by Test Results:**
  - The widget is expected to display a warning when PCA preprocessing is disabled and the dataset has a large number of features. However, before the commit, this warning was not present, causing the test to fail.

- **Expected Behavior:**
  - When PCA preprocessing is disabled and the dataset contains many features, the widget should display a warning advising the user to enable PCA preprocessing to improve performance.

- **Actual Behavior or Error Message:**
  - The warning is not displayed, leading to potential performance issues without user awareness.

- **Issue Description:**
  - The issue should clearly state that the widget fails to display a necessary warning under specific conditions, providing details on how to reproduce the problem and what the expected outcome should be.

---

[ISSUE]
**Title:** Missing Warning When PCA Preprocessing is Disabled with High-Dimensional Data

**Description:**

When PCA preprocessing is turned off in the t-SNE widget and the input dataset contains a large number of features, the widget does not display a warning. This omission can lead to unexpected slowdowns during computation without informing the user of the potential performance impact.

**Steps to Reproduce:**

1. Open the t-SNE widget in the application.
2. Disable the PCA preprocessing option.
3. Input a dataset with a high number of features (e.g., 250 features).
4. Run the t-SNE computation.

**Expected Behavior:**

A warning message should appear indicating that the input data has a large number of features and recommending enabling PCA preprocessing to enhance computation speed.

**Actual Behavior:**

No warning is displayed, leaving users unaware that disabling PCA preprocessing with high-dimensional data may result in slower performance.

**Example Code Snippet:**

```python
# Example setup in the widget
widget.controls.use_pca_preprocessing.setChecked(False)
data_large = Table.from_numpy(Domain.from_numpy(np.random.normal(0, 1, size=(50, 250))), np.random.normal(0, 1, size=(50, 250)))
widget.send_signal(widget.Inputs.data, data_large)
widget.run_button.click()
# Expected: Warning.consider_using_pca_preprocessing is_shown()
# Actual: AttributeError or no warning displayed
```
[/ISSUE]
--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.

--- BEGIN FILE ---
```
### Orange/widgets/unsupervised/owtsne.py
import warnings
from functools import partial
from types import SimpleNamespace as namespace
from typing import Optional  # pylint: disable=unused-import

import numpy as np

from AnyQt.QtCore import Qt
from AnyQt.QtWidgets import QFormLayout

from Orange.data import Table, Domain
from Orange.preprocess import preprocess
from Orange.projection import PCA
from Orange.projection import manifold
from Orange.widgets import gui
from Orange.widgets.settings import SettingProvider, ContextSetting
from Orange.widgets.utils.concurrent import TaskState, ConcurrentWidgetMixin
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.visualize.owscatterplotgraph import OWScatterPlotBase
from Orange.widgets.visualize.utils.widget import OWDataProjectionWidget
from Orange.widgets.widget import Msg

_STEP_SIZE = 25
_MAX_PCA_COMPONENTS = 50
_DEFAULT_PCA_COMPONENTS = 20


class Task(namespace):
    """Completely determines the t-SNE task spec and intermediate results."""
    data = None                     # type: Optional[Table]

    normalize = None                # type: Optional[bool]
    normalized_data = None          # type: Optional[Table]

    use_pca_preprocessing = None    # type: Optional[bool]
    pca_components = None           # type: Optional[int]
    pca_projection = None           # type: Optional[Table]

    perplexity = None               # type: Optional[float]
    multiscale = None               # type: Optional[bool]
    exaggeration = None             # type: Optional[float]
    initialization = None           # type: Optional[np.ndarray]
    affinities = None               # type: Optional[openTSNE.affinity.Affinities]
    tsne_embedding = None           # type: Optional[manifold.TSNEModel]
    iterations_done = 0             # type: int

    # These attributes need not be set by the widget
    tsne = None                     # type: Optional[manifold.TSNE]
    # `effective_data` stores the current working matrix which should be used
    # for any steps depending on the data matrix. For instance, normalization
    # should use the effective data (presumably the original data), and set it
    # to the normalized version upon completion. This can then later be used for
    # PCA preprocessing
    effective_data = None           # type: Optional[Table]

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        # Set `effective_data` to data if data provided, and effective data
        # not provided
        if self.effective_data is None and self.data is not None:
            self.effective_data = self.data


def data_normalization(data):
    normalization = preprocess.Normalize()
    return normalization(data)


def pca_preprocessing(data, n_components):
    projector = PCA(n_components=n_components, random_state=0)
    model = projector(data)
    return model(data)


def prepare_tsne_obj(data, perplexity, multiscale, exaggeration):
    # type: (Table, float, bool, float) -> manifold.TSNE
    """Automatically determine the best parameters for the given data set."""
    # Compute perplexity settings for multiscale
    n_samples = data.X.shape[0]
    if multiscale:
        perplexity = min((n_samples - 1) / 3, 50), min((n_samples - 1) / 3, 500)
    else:
        perplexity = perplexity

    return manifold.TSNE(
        n_components=2,
        perplexity=perplexity,
        multiscale=multiscale,
        exaggeration=exaggeration,
        random_state=0,
    )


class TSNERunner:
    @staticmethod
    def compute_normalization(task: Task, state: TaskState, **_) -> None:
        state.set_status("Normalizing data...")
        task.normalized_data = data_normalization(task.effective_data)
        task.effective_data = task.normalized_data
        state.set_partial_result(("normalized_data", task))

    @staticmethod
    def compute_pca(task: Task, state: TaskState, **_) -> None:
        # Perform PCA preprocessing
        state.set_status("Computing PCA...")
        pca_projection = pca_preprocessing(task.effective_data, task.pca_components)
        # Apply t-SNE's preprocessors to the data
        task.pca_projection = task.tsne.preprocess(pca_projection)
        task.effective_data = task.pca_projection
        state.set_partial_result(("pca_projection", task))

    @staticmethod
    def compute_initialization(task: Task, state: TaskState, **_) -> None:
        # Prepare initial positions for t-SNE
        state.set_status("Preparing initialization...")
        task.initialization = task.tsne.compute_initialization(task.effective_data.X)
        state.set_partial_result(("initialization", task))

    @staticmethod
    def compute_affinities(task: Task, state: TaskState, **_) -> None:
        # Compute affinities
        state.set_status("Finding nearest neighbors...")
        task.affinities = task.tsne.compute_affinities(task.effective_data.X)
        state.set_partial_result(("affinities", task))

    @staticmethod
    def compute_tsne(task: Task, state: TaskState, progress_callback=None) -> None:
        tsne = task.tsne

        state.set_status("Running optimization...")

        # If this the first time we're computing t-SNE (otherwise we may just
        # be resuming optimization), we have to assemble the tsne object
        if task.tsne_embedding is None:
            # Assemble a t-SNE embedding object and convert it to a TSNEModel
            task.tsne_embedding = tsne.prepare_embedding(
                task.affinities, task.initialization
            )
            task.tsne_embedding = tsne.convert_embedding_to_model(
                task.effective_data, task.tsne_embedding
            )
            state.set_partial_result(("tsne_embedding", task))

            if state.is_interruption_requested():
                return

        total_iterations_needed = tsne.early_exaggeration_iter + tsne.n_iter

        def run_optimization(tsne_params: dict, iterations_needed: int) -> bool:
            """Run t-SNE optimization phase. Return value indicates whether the
            optimization was interrupted."""
            while task.iterations_done < iterations_needed:
                # Step size can't be larger than the remaining number of iterations
                step_size = min(_STEP_SIZE, iterations_needed - task.iterations_done)
                task.tsne_embedding = task.tsne_embedding.optimize(
                    step_size, **tsne_params
                )
                task.iterations_done += step_size
                state.set_partial_result(("tsne_embedding", task))
                if progress_callback is not None:
                    # The current iterations must be divided by the total
                    # number of iterations, not the number of iterations in the
                    # current phase (iterations_needed)
                    progress_callback(task.iterations_done / total_iterations_needed)

                if state.is_interruption_requested():
                    return True

        # Run early exaggeration phase
        was_interrupted = run_optimization(
            dict(exaggeration=tsne.early_exaggeration, momentum=0.8, inplace=False),
            iterations_needed=tsne.early_exaggeration_iter,
        )
        if was_interrupted:
            return
        # Run regular optimization phase
        run_optimization(
            dict(exaggeration=tsne.exaggeration, momentum=0.8, inplace=False),
            iterations_needed=total_iterations_needed,
        )

    @classmethod
    def run(cls, task: Task, state: TaskState) -> Task:
        # Assign weights to each job indicating how much time will be spent on each
        weights = {"normalization": 1, "pca": 1, "init": 1, "aff": 25, "tsne": 50}
        total_weight = sum(weights.values())

        # Prepare the tsne object and add it to the spec
        task.tsne = prepare_tsne_obj(
            task.data, task.perplexity, task.multiscale, task.exaggeration
        )

        job_queue = []
        # Add the tasks that still need to be run to the job queue
        task.effective_data = task.data

        if task.normalize and task.normalized_data is None:
            job_queue.append((cls.compute_normalization, weights["normalization"]))

        if task.use_pca_preprocessing and task.pca_projection is None:
            job_queue.append((cls.compute_pca, weights["pca"]))

        if task.initialization is None:
            job_queue.append((cls.compute_initialization, weights["init"]))

        if task.affinities is None:
            job_queue.append((cls.compute_affinities, weights["aff"]))

        total_iterations = task.tsne.early_exaggeration_iter + task.tsne.n_iter
        if task.tsne_embedding is None or task.iterations_done < total_iterations:
            job_queue.append((cls.compute_tsne, weights["tsne"]))

        job_queue = [(partial(f, task, state), w) for f, w in job_queue]

        # Ensure the effective data is set to the appropriate, potentially
        # precomputed matrix
        task.effective_data = task.data
        if task.normalize and task.normalized_data is not None:
            task.effective_data = task.normalized_data
        if task.use_pca_preprocessing and task.pca_projection is not None:
            task.effective_data = task.pca_projection

        # Figure out the total weight of the jobs
        job_weight = sum(j[1] for j in job_queue)
        progress_done = total_weight - job_weight
        for job, job_weight in job_queue:

            def _progress_callback(val):
                state.set_progress_value(
                    (progress_done + val * job_weight) / total_weight * 100
                )

            if state.is_interruption_requested():
                return task

            # Execute the job
            job(progress_callback=_progress_callback)
            # Update the progress bar according to the weights assigned to
            # each job
            progress_done += job_weight
            state.set_progress_value(progress_done / total_weight * 100)

        return task


class OWtSNEGraph(OWScatterPlotBase):
    def update_coordinates(self):
        super().update_coordinates()
        if self.scatterplot_item is not None:
            self.view_box.setAspectLocked(True, 1)


class invalidated:
    # pylint: disable=invalid-name
    normalized_data = pca_projection = affinities = tsne_embedding = False

    def __set__(self, instance, value):
        # `self._invalidate = True` should invalidate everything
        self.normalized_data = value
        self.pca_projection = value
        self.affinities = value
        self.tsne_embedding = value

    def __bool__(self):
        # If any of the values are invalidated, this should return true
        return (
            self.normalized_data or self.pca_projection or self.affinities or
            self.tsne_embedding
        )

    def __str__(self):
        return "%s(%s)" % (self.__class__.__name__, ", ".join(
            "=".join([k, str(getattr(self, k))])
            for k in ["normalized_data", "pca_projection", "affinities",
                      "tsne_embedding"]
        ))


class OWtSNE(OWDataProjectionWidget, ConcurrentWidgetMixin):
    name = "t-SNE"
    description = "Two-dimensional data projection with t-SNE."
    icon = "icons/TSNE.svg"
    priority = 920
    keywords = "t-sne, tsne"

    settings_version = 4
    perplexity = ContextSetting(30)
    multiscale = ContextSetting(False)
    exaggeration = ContextSetting(1)

    normalize = ContextSetting(True)
    use_pca_preprocessing = ContextSetting(True)
    pca_components = ContextSetting(_DEFAULT_PCA_COMPONENTS)

    GRAPH_CLASS = OWtSNEGraph
    graph = SettingProvider(OWtSNEGraph)
    embedding_variables_names = ("t-SNE-x", "t-SNE-y")

    # Use `invalidated` descriptor, so we don't break the usage of
    # `_invalidated` in `OWDataProjectionWidget`, but still allow finer control
    # over which parts of the embedding to invalidate
    _invalidated = invalidated()

    class Information(OWDataProjectionWidget.Information):
        modified = Msg("The parameter settings have been changed. Press "
                       "\"Start\" to rerun with the new settings.")

    class Error(OWDataProjectionWidget.Error):
        not_enough_rows = Msg("Input data needs at least 2 rows")
        not_enough_cols = Msg("Input data needs at least 2 attributes")
        constant_data = Msg("Input data is constant")
        no_valid_data = Msg("No projection due to no valid data")

    def __init__(self):
        OWDataProjectionWidget.__init__(self)
        ConcurrentWidgetMixin.__init__(self)
        # Intermediate results
        self.normalized_data = None       # type: Optional[Table]
        self.pca_projection = None        # type: Optional[Table]
        self.initialization = None        # type: Optional[np.ndarray]
        self.affinities = None            # type: Optional[openTSNE.affinity.Affinities]
        self.tsne_embedding = None        # type: Optional[manifold.TSNEModel]
        self.iterations_done = 0          # type: int

    @property
    def effective_data(self):
        return self.data.transform(Domain(self.effective_variables))

    def _add_controls(self):
        self._add_controls_start_box()
        super()._add_controls()

    def _add_controls_start_box(self):
        preprocessing_box = gui.vBox(self.controlArea, box="Preprocessing")
        self.normalize_cbx = gui.checkBox(
            preprocessing_box, self, "normalize", "Normalize data",
            callback=self._invalidate_normalized_data,
        )
        self.pca_preprocessing_cbx = gui.checkBox(
            preprocessing_box, self, "use_pca_preprocessing", "Preprocess using PCA",
            callback=self._pca_preprocessing_changed,
        )
        self.pca_component_slider = gui.hSlider(
            preprocessing_box, self, "pca_components", label="PCA Components:",
            minValue=2, maxValue=_MAX_PCA_COMPONENTS, step=1,
            callback=self._invalidate_pca_projection,
        )

        box = gui.vBox(self.controlArea, box="Parameters")
        form = QFormLayout(
            labelAlignment=Qt.AlignLeft,
            formAlignment=Qt.AlignLeft,
            fieldGrowthPolicy=QFormLayout.AllNonFixedFieldsGrow,
        )

        self.perplexity_spin = gui.spin(
            box, self, "perplexity", 1, 500, step=1, alignment=Qt.AlignRight,
            callback=self._invalidate_affinities, addToLayout=False
        )
        self.controls.perplexity.setDisabled(self.multiscale)
        form.addRow("Perplexity:", self.perplexity_spin)
        form.addRow(gui.checkBox(
            box, self, "multiscale", label="Preserve global structure",
            callback=self._multiscale_changed, addToLayout=False
        ))

        sbe = gui.hBox(self.controlArea, False, addToLayout=False)
        gui.hSlider(
            sbe, self, "exaggeration", minValue=1, maxValue=4, step=1,
            callback=self._invalidate_tsne_embedding,
        )
        form.addRow("Exaggeration:", sbe)

        box.layout().addLayout(form)

        self.run_button = gui.button(box, self, "Start", callback=self._toggle_run)

    # Control callbacks
    def _normalize_data_changed(self):
        self._invalidate_normalized_data()

    def _pca_preprocessing_changed(self):
        self.controls.pca_components.setEnabled(self.use_pca_preprocessing)
        self._invalidate_pca_projection()

    def _multiscale_changed(self):
        self.controls.perplexity.setDisabled(self.multiscale)
        self._invalidate_affinities()

    # Invalidateion cascade
    def _invalidate_normalized_data(self):
        self._invalidated.normalized_data = True
        self._invalidate_pca_projection()

    def _invalidate_pca_projection(self):
        self._invalidated.pca_projection = True
        self._invalidate_affinities()

    def _invalidate_affinities(self):
        self._invalidated.affinities = True
        self._invalidate_tsne_embedding()

    def _invalidate_tsne_embedding(self):
        self._invalidated.tsne_embedding = True
        self._stop_running_task()
        self._set_modified(True)

    def _stop_running_task(self):
        self.cancel()
        self.run_button.setText("Start")

    def _set_modified(self, state):
        """Mark the widget (GUI) as containing modified state."""
        if self.data is None:
            # Does not apply when we have no data
            state = False
        self.Information.modified(shown=state)

    def check_data(self):
        def error(err):
            err()
            self.data = None

        # `super().check_data()` clears all messages, so we have to remember if
        # it was shown
        # pylint: disable=assignment-from-no-return
        should_show_modified_message = self.Information.modified.is_shown()
        super().check_data()

        if self.data is None:
            return

        self.Information.modified(shown=should_show_modified_message)

        if len(self.data) < 2:
            error(self.Error.not_enough_rows)

        elif len(self.data.domain.attributes) < 2:
            error(self.Error.not_enough_cols)

        elif not self.data.is_sparse():
            if np.all(~np.isfinite(self.data.X)):
                error(self.Error.no_valid_data)
            else:
                with warnings.catch_warnings():
                    warnings.filterwarnings(
                        "ignore", "Degrees of freedom .*", RuntimeWarning)
                    if np.nan_to_num(np.nanstd(self.data.X, axis=0)).sum() \
                            == 0:
                        error(self.Error.constant_data)

    def get_embedding(self):
        if self.tsne_embedding is None:
            self.valid_data = None
            return None

        embedding = self.tsne_embedding.embedding.X
        self.valid_data = np.ones(len(embedding), dtype=bool)
        return embedding

    def _toggle_run(self):
        # If no data, there's nothing to do
        if self.data is None:
            return

        # Pause task
        if self.task is not None:
            self.cancel()
            self.run_button.setText("Resume")
            self.commit.deferred()
        # Resume task
        else:
            self.run()

    def handleNewSignals(self):
        # We don't bother with the granular invalidation flags because
        # `super().handleNewSignals` will just set all of them to False or will
        # do nothing. However, it's important we remember its state because we
        # won't call `run` if needed. `run` also relies on the state of
        # `_invalidated` to properly set the intermediate values to None
        prev_invalidated = bool(self._invalidated)
        super().handleNewSignals()
        self._invalidated = prev_invalidated

        if self._invalidated:
            self.run()

    def init_attr_values(self):
        super().init_attr_values()

        if self.data is not None:
            n_attrs = len(self.data.domain.attributes)
            max_components = min(_MAX_PCA_COMPONENTS, n_attrs)
        else:
            max_components = _MAX_PCA_COMPONENTS

        # We set this to the default number of components here so it resets
        # properly, any previous settings will be restored from context
        # settings a little later
        self.controls.pca_components.setMaximum(max_components)
        self.controls.pca_components.setValue(_DEFAULT_PCA_COMPONENTS)

        self.exaggeration = 1

    def enable_controls(self):
        super().enable_controls()

        if self.data is not None:
            # PCA doesn't support normalization on sparse data, as this would
            # require centering and normalizing the matrix
            self.normalize_cbx.setDisabled(self.data.is_sparse())
            if self.data.is_sparse():
                self.normalize = False
                self.normalize_cbx.setToolTip(
                    "Data normalization is not supported on sparse matrices."
                )
            else:
                self.normalize_cbx.setToolTip("")

        # Disable the perplexity spin box if multiscale is turned on
        self.controls.perplexity.setDisabled(self.multiscale)

    def run(self):
        # Reset invalidated values as indicated by the flags
        if self._invalidated.pca_projection:
            self.pca_projection = None
        if self._invalidated.affinities:
            self.affinities = None
        if self._invalidated.tsne_embedding:
            self.iterations_done = 0
            self.tsne_embedding = None

        self._set_modified(False)
        self._invalidated = False

        # When the data is invalid, it is set to `None` and an error is set,
        # therefore it would be erroneous to clear the error here
        if self.data is not None:
            self.run_button.setText("Stop")

        # Cancel current running task
        self.cancel()

        if self.data is None:
            return

        task = Task(
            data=self.data,
            # Normalization
            normalize=self.normalize,
            normalized_data=self.normalized_data,
            # PCA preprocessing
            use_pca_preprocessing=self.use_pca_preprocessing,
            pca_components=self.pca_components,
            pca_projection=self.pca_projection,
            # t-SNE parameters
            perplexity=self.perplexity,
            multiscale=self.multiscale,
            exaggeration=self.exaggeration,
            initialization=self.initialization,
            affinities=self.affinities,
            # Misc
            tsne_embedding=self.tsne_embedding,
            iterations_done=self.iterations_done,
        )
        return self.start(TSNERunner.run, task)

    def __ensure_task_same_for_normalization(self, task: Task):
        assert self.data is not None
        assert task.normalize == self.normalize
        if task.normalize:
            assert isinstance(task.normalized_data, Table) and \
                len(task.normalized_data) == len(self.data)

    def __ensure_task_same_for_pca(self, task: Task):
        assert self.data is not None
        assert task.use_pca_preprocessing == self.use_pca_preprocessing
        if task.use_pca_preprocessing:
            assert task.pca_components == self.pca_components
            assert isinstance(task.pca_projection, Table) and \
                len(task.pca_projection) == len(self.data)

    def __ensure_task_same_for_initialization(self, task: Task):
        assert isinstance(task.initialization, np.ndarray) and \
            len(task.initialization) == len(self.data)

    def __ensure_task_same_for_affinities(self, task: Task):
        assert task.perplexity == self.perplexity
        assert task.multiscale == self.multiscale

    def __ensure_task_same_for_embedding(self, task: Task):
        assert task.exaggeration == self.exaggeration
        assert isinstance(task.tsne_embedding, manifold.TSNEModel) and \
            len(task.tsne_embedding.embedding) == len(self.data)

    def on_partial_result(self, value):
        # type: (Tuple[str, Task]) -> None
        which, task = value

        if which == "normalized_data":
            self.__ensure_task_same_for_normalization(task)
            self.normalized_data = task.normalized_data
        elif which == "pca_projection":
            self.__ensure_task_same_for_normalization(task)
            self.__ensure_task_same_for_pca(task)
            self.pca_projection = task.pca_projection
        elif which == "initialization":
            self.__ensure_task_same_for_normalization(task)
            self.__ensure_task_same_for_pca(task)
            self.__ensure_task_same_for_initialization(task)
            self.initialization = task.initialization
        elif which == "affinities":
            self.__ensure_task_same_for_normalization(task)
            self.__ensure_task_same_for_pca(task)
            self.__ensure_task_same_for_affinities(task)
            self.affinities = task.affinities
        elif which == "tsne_embedding":
            self.__ensure_task_same_for_normalization(task)
            self.__ensure_task_same_for_pca(task)
            self.__ensure_task_same_for_initialization(task)
            self.__ensure_task_same_for_affinities(task)
            self.__ensure_task_same_for_embedding(task)

            prev_embedding, self.tsne_embedding = self.tsne_embedding, task.tsne_embedding
            self.iterations_done = task.iterations_done
            # If this is the first partial result we've gotten, we've got to
            # setup the plot
            if prev_embedding is None:
                self.setup_plot()
            # Otherwise, just update the point positions
            else:
                self.graph.update_coordinates()
                self.graph.update_density()
        else:
            raise RuntimeError(
                "Unrecognized partial result called with `%s`" % which
            )

    def on_done(self, task):
        # type: (Task) -> None
        self.run_button.setText("Start")
        # NOTE: All of these have already been set by on_partial_result,
        # we double check that they are aliases
        if task.pca_projection is not None:
            self.__ensure_task_same_for_pca(task)
            assert task.pca_projection is self.pca_projection
        if task.initialization is not None:
            self.__ensure_task_same_for_initialization(task)
            assert task.initialization is self.initialization
        if task.affinities is not None:
            assert task.affinities is self.affinities
        if task.tsne_embedding is not None:
            self.__ensure_task_same_for_embedding(task)
            assert task.tsne_embedding is self.tsne_embedding

        self.commit.deferred()

    def _get_projection_data(self):
        if self.data is None:
            return None

        data = self.data.transform(
            Domain(
                self.data.domain.attributes,
                self.data.domain.class_vars,
                self.data.domain.metas + self._get_projection_variables()
            )
        )
        with data.unlocked(data.metas):
            data.metas[:, -2:] = self.get_embedding()
        if self.tsne_embedding is not None:
            data.domain = Domain(
                self.data.domain.attributes,
                self.data.domain.class_vars,
                self.data.domain.metas + self.tsne_embedding.domain.attributes,
            )
        return data

    def clear(self):
        """Clear widget state. Note that this doesn't clear the data."""
        super().clear()
        self.run_button.setText("Start")
        self.cancel()
        self.normalized_data = None
        self.pca_projection = None
        self.initialization = None
        self.affinities = None
        self.tsne_embedding = None
        self.iterations_done = 0

    def onDeleteWidget(self):
        self.clear()
        self.data = None
        self.shutdown()
        super().onDeleteWidget()

    @classmethod
    def migrate_settings(cls, settings, version):
        if version < 3:
            if "selection_indices" in settings:
                settings["selection"] = settings["selection_indices"]
        if version < 4:
            settings.pop("max_iter", None)

    @classmethod
    def migrate_context(cls, context, version):
        if version < 3:
            values = context.values
            values["attr_color"] = values["graph"]["attr_color"]
            values["attr_size"] = values["graph"]["attr_size"]
            values["attr_shape"] = values["graph"]["attr_shape"]
            values["attr_label"] = values["graph"]["attr_label"]


if __name__ == "__main__":
    import sys
    data = Table(sys.argv[1] if len(sys.argv) > 1 else "iris")
    WidgetPreview(OWtSNE).run(
        set_data=data,
        set_subset_data=data[np.random.choice(len(data), 10)],
    )

```
--- END FILE ---

Please first localize the bug based on the issue statement, and then generate *SEARCH/REPLACE* edits to fix the issue.

Every *SEARCH/REPLACE* edit must use this format:
1. The file path
2. The start of search block: <<<<<<< SEARCH
3. A contiguous chunk of lines to search for in the existing source code
4. The dividing line: =======
5. The lines to replace into the source code
6. The end of the replace block: >>>>>>> REPLACE

Here is an example:

```python
### mathweb/flask/app.py
<<<<<<< SEARCH
from flask import Flask
=======
import math
from flask import Flask
>>>>>>> REPLACE
```
</solution>

Please note that the *SEARCH/REPLACE* edit REQUIRES PROPER INDENTATION. If you would like to add the line '        print(x)', you must fully write that out, with all those spaces before the code!
Wrap each *SEARCH/REPLACE* edit in a code block as shown in the example above. If you have multiple *SEARCH/REPLACE* edits, use a separate code block for each one.
user