8ccf40aa8b80f2c22289483eafa0166abf706360,examples/tutorials/scipy2008/tool_chooser.py,ToolChooserExample,_tools_changed,#ToolChooserExample#,30
Before Change
def _tools_changed(self):
classes = [eval(class_name) for class_name in self.tools]
// Remove all tools that are not in the enabled list in self.tools
for tool in self.plot.tools:
if tool.__class__ not in classes:
self.plot.tools.remove(tool)
else:
classes.remove(tool.__class__)
// Create new instances of tools for the remaining tool classes
for cls in classes:
self.plot.tools.append(cls(self.plot))
return
After Change
classes = [eval(class_name) for class_name in self.tools]
// Remove all tools from the plot
plot_tools = self.plot.tools
for tool in plot_tools:
plot_tools.remove(tool)
// Create new instances for the selected tool classes
for cls in classes:
self.plot.tools.append(cls(self.plot))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: enthought/chaco
Commit Name: 8ccf40aa8b80f2c22289483eafa0166abf706360
Time: 2011-11-30
Author: pietro.berkes@googlemail.com
File Name: examples/tutorials/scipy2008/tool_chooser.py
Class Name: ToolChooserExample
Method Name: _tools_changed
Project Name: invesalius/invesalius3
Commit Name: bfaca5dcfc55113e3f8fd3134e21ae9567a4097c
Time: 2016-08-12
Author: totonixsame@gmail.com
File Name: invesalius/data/viewer_slice.py
Class Name: Viewer
Method Name: UpdateCanvas
Project Name: scikit-image/scikit-image
Commit Name: f8d9a6c144ef84bad2478a4ba4eedb1c559274e0
Time: 2020-11-11
Author: rfezzani@gmail.com
File Name: skimage/_shared/coord.py
Class Name:
Method Name: ensure_spacing