a0d5162fb500d43f4be26fd402271fc888397464,Orange/tests/test_classification.py,LearnerAccessibility,test_all_models_work_after_unpickling,#LearnerAccessibility#,204
Before Change
traceback.print_exc()
continue
model2 = pickle.loads(pickle.dumps(model))
np.testing.assert_almost_equal(model(iris), model2(iris),
err_msg="%s does not return same values when unpickled" % learner.__name__)
After Change
def test_all_models_work_after_unpickling(self):
Variable._clear_all_caches()
datasets = [Table("iris"), Table("titanic")]
for learner in list(self.all_learners()):
try:
learner = learner()
except Exception as err:
print("%s cannot be used with default parameters" % learner.__name__)
traceback.print_exc()
continue
for ds in datasets:
model = learner(ds)
s = pickle.dumps(model, 0)
model2 = pickle.loads(s)
np.testing.assert_almost_equal(Table(model.domain, ds).X, Table(model2.domain, ds).X)
np.testing.assert_almost_equal(model(ds), model2(ds),
err_msg="%s does not return same values when unpickled %s" % (learner.__class__.__name__, ds.name))
//print("%s on %s works" % (learner, ds.name))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances Project Name: biolab/orange3
Commit Name: a0d5162fb500d43f4be26fd402271fc888397464
Time: 2015-06-24
Author: anze.staric@gmail.com
File Name: Orange/tests/test_classification.py
Class Name: LearnerAccessibility
Method Name: test_all_models_work_after_unpickling
Project Name: tensorflow/transform
Commit Name: 20ca3b56aeaeb02727fe188b591fbbce6f6ddaac
Time: 2018-11-13
Author: tf-transform-dev@google.com
File Name: tensorflow_transform/coders/example_proto_coder_test.py
Class Name: ExampleProtoCoderTest
Method Name: test_example_proto_coder_picklable
Project Name: tensorflow/transform
Commit Name: 11c45fd485c44702516dc1c0bbc0c17a9e21512e
Time: 2018-10-29
Author: tf-transform-dev@google.com
File Name: tensorflow_transform/coders/csv_coder_test.py
Class Name: TestCSVCoder
Method Name: test_picklable