1f32f952d84f0d44fcfe03367d3834d2464b63a0,nilmtk/disaggregate/combinatorial_optimisation.py,CombinatorialOptimisation,export_model,#CombinatorialOptimisation#,266

Before Change


        for pair in exported_model.model:
            pair["training_metadata"].store = (
                pair["training_metadata"].store.store.filename)
        pickle.dump(exported_model, open(filename, "wb"))

After Change


            pair["training_metadata"].store = original_store.store.filename
    
        try:
            with open(filename, "wb") as out_file:
                pickle.dump(self, out_file)
        finally:
            // Restore the stores even if the pickling fails
            for original_store, pair in zip(original_stores, self.model):
                pair["training_metadata"].store = original_store
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: nilmtk/nilmtk
Commit Name: 1f32f952d84f0d44fcfe03367d3834d2464b63a0
Time: 2018-04-22
Author: 10246101+PMeira@users.noreply.github.com
File Name: nilmtk/disaggregate/combinatorial_optimisation.py
Class Name: CombinatorialOptimisation
Method Name: export_model


Project Name: victoresque/pytorch-template
Commit Name: 39cc03ca3193a4ec8c2b20a55be31ab38da72e1d
Time: 2018-09-21
Author: borgesan@ifi.uio.no
File Name: base/base_trainer.py
Class Name: BaseTrainer
Method Name: __init__


Project Name: ReactionMechanismGenerator/RMG-Py
Commit Name: 403b44c95c9a11c3b457d65e41aa8b45d6d7ed03
Time: 2019-09-10
Author: mjliu@mit.edu
File Name: rmgpy/yml.py
Class Name:
Method Name: writeyml


Project Name: victoresque/pytorch-template
Commit Name: d01c29228db3bffb451be36e2d556262597971c9
Time: 2018-09-21
Author: borgesan@ifi.uio.no
File Name: base/base_trainer.py
Class Name: BaseTrainer
Method Name: __init__