82844481da6e1f3d391541d47af0c1466679f0f0,nilmtk/metergroup.py,MeterGroup,__getitem__,#MeterGroup#,107

Before Change


            for meter in self.meters: // TODO: write unit tests for this
                if isinstance(meter, MeterGroup):
                    metergroup = meter
                    meter_ids = set([m.identifier for m in metergroup.meters
                                     if isinstance(m, ElecMeter)])
                    if meter_ids == set(key):
                        return meter
            raise KeyError(key)
        elif isinstance(key, tuple):

After Change


                        group.building() == key.building and
                        group.dataset() == key.dataset):
                        return group
            elif key.instance == 0:
                metergroup_of_building = nilmtk.global_meter_group.select(
                    building=key.building, dataset=key.dataset)
                return metergroup_of_building.mains()
            else:
                for meter in self.meters:
                    if meter.identifier == key:
                        return meter
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: nilmtk/nilmtk
Commit Name: 82844481da6e1f3d391541d47af0c1466679f0f0
Time: 2014-07-11
Author: jack-list@xlk.org.uk
File Name: nilmtk/metergroup.py
Class Name: MeterGroup
Method Name: __getitem__


Project Name: andresriancho/w3af
Commit Name: 738966599b7e1eba13da06aa947797c01a54d26a
Time: 2018-07-19
Author: andres.riancho@gmail.com
File Name: w3af/plugins/grep/cross_domain_js.py
Class Name: cross_domain_js
Method Name: _load_secure_js_file


Project Name: ilastik/ilastik
Commit Name: 8861dfa21d1cfd487b7a6eb7508885f084f58e6c
Time: 2019-07-10
Author: tomaz.vieira@embl.de
File Name: ilastik/applets/dataSelection/datasetInfoEditorWidget.py
Class Name: DatasetInfoEditorWidget
Method Name: get_new_axes_tags