# Buggy code
def set_data(self, data):
    self.data, old_data = data, self.data
    self.selection = None
    self._set_input_summary()

    # Do not needlessly recluster the data if X hasn't changed
    if old_data and self.data and array_equal(self.data.X, old_data.X):
        if self.auto_commit:
            self.send_data()
    else:
        self.invalidate(unconditional=True)


# Traceback (ValueError)
Traceback (most recent call last):
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/orangecanvas/scheme/signalmanager.py", line 936, in __process_next
if self.__process_next_helper(use_max_active=True):
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/orangecanvas/scheme/signalmanager.py", line 974, in __process_next_helper
self.process_node(selected_node)
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/orangecanvas/scheme/signalmanager.py", line 605, in process_node
self.send_to_node(node, signals_in)
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/orangewidget/workflow/widgetsscheme.py", line 792, in send_to_node
self.process_signals_for_widget(node, widget, signals)
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/orangewidget/workflow/widgetsscheme.py", line 826, in process_signals_for_widget
handler(*args)
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Orange/widgets/utils/sql.py", line 31, in new_f
return f(widget, data, *args, **kwargs)
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Orange/widgets/unsupervised/owkmeans.py", line 578, in set_data
self.invalidate(unconditional=True)
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Orange/widgets/unsupervised/owkmeans.py", line 458, in invalidate
self.unconditional_commit()
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Orange/widgets/unsupervised/owkmeans.py", line 444, in commit
self.run_optimization()
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Orange/widgets/unsupervised/owkmeans.py", line 403, in run_optimization
self.__launch_tasks(needed_ks)
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Orange/widgets/unsupervised/owkmeans.py", line 357, in __launch_tasks
preprocessed_data = self.preproces(self.data)
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Orange/widgets/unsupervised/owkmeans.py", line 493, in preproces
data = Normalize()(data)
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Orange/preprocess/preprocess.py", line 356, in __call__
return normalizer(data)
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Orange/preprocess/normalize.py", line 36, in __call__
return data.transform(domain)
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Orange/data/table.py", line 520, in transform
return type(self).from_table(domain, self)
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/orangecontrib/text/corpus.py", line 508, in from_table
t = super().from_table(domain, source, row_indices)
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Orange/data/table.py", line 463, in from_table
variables=domain.attributes)
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Orange/data/table.py", line 397, in get_columns
col_array = match_density(col(source))
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Orange/preprocess/transformation.py", line 38, in __call__
transformed = self.transform(col)
File "/Applications/Orange3.app/Contents/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/Orange/preprocess/transformation.py", line 127, in transform
raise ValueError('Normalization does not work for sparse data.')
ValueError: Normalization does not work for sparse data.

# Fixed code
def set_data(self, data):
    self.data, old_data = data, self.data
    self.selection = None
    self._set_input_summary()

    self.controls.normalize.setDisabled(bool(self.data) and sp.issparse(self.data.X))

    # Do not needlessly recluster the data if X hasn't changed
    if old_data and self.data and array_equal(self.data.X, old_data.X):
        if self.auto_commit:
            self.send_data()
    else:
        self.invalidate(unconditional=True)