f8b10a94d74d32f2ba0ff792f75a7335ab0c2651,allennlp/training/trainer_base.py,TrainerBase,from_params,#Any#Any#Any#Any#,62

Before Change


                                       params=pieces.params,
                                       validation_iterator=pieces.validation_iterator)
        else:
            return TrainerBase.by_name(typ3).from_params(params, serialization_dir, recover)

After Change


                                       params=pieces.params,
                                       validation_iterator=pieces.validation_iterator)
        else:
            klass = TrainerBase.by_name(typ3)
            // Explicit check to prevent recursion.
            is_overriden = klass.from_params.__func__ != TrainerBase.from_params.__func__ // type: ignore
            assert is_overriden, f"Class {klass.__name__} must override `from_params`."
            return klass.from_params(params, serialization_dir, recover)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: allenai/allennlp
Commit Name: f8b10a94d74d32f2ba0ff792f75a7335ab0c2651
Time: 2019-03-18
Author: brendanr@allenai.org
File Name: allennlp/training/trainer_base.py
Class Name: TrainerBase
Method Name: from_params


Project Name: allenai/allennlp
Commit Name: ae69b9ea7807e25c1cab23c4d148a15f1eaaa180
Time: 2020-01-14
Author: mattg@allenai.org
File Name: allennlp/models/model.py
Class Name: Model
Method Name: load


Project Name: allenai/allennlp
Commit Name: b71ef434b310e9b1ba400b42c7334c794996b40e
Time: 2018-05-15
Author: murphp15@tcd.ie
File Name: allennlp/training/learning_rate_schedulers.py
Class Name: LearningRateScheduler
Method Name: from_params