9f33b8f541cd2de14abfb7021c3f19acaf1a81c4,homeassistant/components/device_tracker/ddwrt.py,DdWrtDeviceScanner,_update_info,#DdWrtDeviceScanner#,127
Before Change
if not data:
return False
if data:
self.last_results = []
active_clients = data.get("active_wireless", None)
if active_clients:
// This is really lame, instead of using JSON the DD-WRT UI
// uses its own data format for some reason and then
// regex"s out values so I guess I have to do the same,
// LAME!!!
// remove leading and trailing single quotes
clean_str = active_clients.strip().strip(""")
elements = clean_str.split("","")
num_clients = int(len(elements)/9)
for idx in range(0, num_clients):
// get every 9th element which is the MAC address
index = idx * 9
if index < len(elements):
self.last_results.append(elements[index])
return True
return False
After Change
clean_str = active_clients.strip().strip(""")
elements = clean_str.split("","")
self.last_results.extend(item for item in elements
if _MAC_REGEX.match(item))
return True
def get_ddwrt_data(self, url):
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 4
Instances
Project Name: home-assistant/home-assistant
Commit Name: 9f33b8f541cd2de14abfb7021c3f19acaf1a81c4
Time: 2015-10-08
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/device_tracker/ddwrt.py
Class Name: DdWrtDeviceScanner
Method Name: _update_info
Project Name: pyannote/pyannote-audio
Commit Name: 38ae11948794e2b7873d7fa053321c1cf67929ff
Time: 2018-11-30
Author: bredin@limsi.fr
File Name: pyannote/audio/augmentation/noise.py
Class Name: AddNoise
Method Name: __init__
Project Name: OpenNMT/OpenNMT-py
Commit Name: f1aadee66689491a6993070955abe7987b9818fc
Time: 2019-01-23
Author: guillaumekln@users.noreply.github.com
File Name: onmt/utils/loss.py
Class Name:
Method Name: filter_shard_state
Project Name: Alexander-H-Liu/End-to-end-ASR-Pytorch
Commit Name: 807021e2b3917ef5c0f17d409df5bba12ab5d080
Time: 2019-09-23
Author: alexliu36@gmail.com
File Name: corpus/librispeech.py
Class Name: LibriTextDataset
Method Name: __init__
Project Name: stanfordnlp/stanza
Commit Name: de634a0c0df0ff33c20f52d5ebb42b90ad8a82bf
Time: 2020-05-21
Author: horatio@gmail.com
File Name: stanza/models/classifiers/cnn_classifier.py
Class Name:
Method Name: label_text