e7f5953362d50f3caf29b3cb6be18d0bba0e4509,homeassistant/__init__.py,StateMachine,set_state,#StateMachine#Any#Any#Any#,364
Before Change
attributes = attributes or {}
self.lock.acquire()
// Add category if it does not exist
if category not in self.states:
self.states[category] = State(new_state, attributes)
// Change state and fire listeners
else:
old_state = self.states[category]
if old_state.state != new_state or \
old_state.attributes != attributes:
self.states[category] = State(new_state, attributes)
self.bus.fire_event(EVENT_STATE_CHANGED,
{"category": category,
"old_state": old_state,
"new_state": self.states[category]})
self.lock.release()
def get_state(self, category):
Returns a dict (state, last_changed, attributes) describing
the state of the specified category.
After Change
attributes = attributes or {}
with self.lock:
// Add category if it does not exist
if category not in self.states:
self.states[category] = State(new_state, attributes)
// Change state and fire listeners
else:
old_state = self.states[category]
if old_state.state != new_state or \
old_state.attributes != attributes:
self.states[category] = State(new_state, attributes)
self.bus.fire_event(EVENT_STATE_CHANGED,
{"category": category,
"old_state": old_state,
"new_state": self.states[category]})
def get_state(self, category):
Returns a dict (state, last_changed, attributes) describing
the state of the specified category.
with self.lock:
In pattern: SUPERPATTERN
Frequency: 9
Non-data size: 6
Instances Project Name: home-assistant/home-assistant
Commit Name: e7f5953362d50f3caf29b3cb6be18d0bba0e4509
Time: 2014-01-19
Author: Paulus@PaulusSchoutsen.nl
File Name: homeassistant/__init__.py
Class Name: StateMachine
Method Name: set_state
Project Name: Maluuba/nlg-eval
Commit Name: 9bfbbf636fb2a6184d470462545ad3868b1a8fc6
Time: 2018-07-03
Author: haschulz@microsoft.com
File Name: nlgeval/pycocoevalcap/meteor/meteor.py
Class Name: Meteor
Method Name: __del__
Project Name: ilastik/ilastik
Commit Name: 7acc98cb2e33e243ae517cb14a9319585e482bdc
Time: 2015-03-20
Author: webmaster@burgerdev.de
File Name: lazyflow/operators/cacheMemoryManager.py
Class Name: CacheMemoryManager
Method Name: _wait
Project Name: ilastik/ilastik
Commit Name: 88902a81605ff559ca60dd42c9aa67b93b34c9fd
Time: 2014-06-11
Author: bergs@janelia.hhmi.org
File Name: lazyflow/operators/opArrayCache.py
Class Name: OpArrayCache
Method Name: _freeMemory
Project Name: Maluuba/nlg-eval
Commit Name: 9bfbbf636fb2a6184d470462545ad3868b1a8fc6
Time: 2018-07-03
Author: haschulz@microsoft.com
File Name: nlgeval/pycocoevalcap/meteor/meteor.py
Class Name: Meteor
Method Name: _score
Project Name: home-assistant/home-assistant
Commit Name: 31b9f65513ea2fb59a91facc08550698f9697408
Time: 2014-12-04
Author: Paulus@PaulusSchoutsen.nl
File Name: homeassistant/components/device_tracker/tomato.py
Class Name: TomatoDeviceScanner
Method Name: _update_tomato_info
Project Name: SpiNNakerManchester/sPyNNaker
Commit Name: 2f2cfbf4cccfa0f9b1aaf114baa3c1be3c777f5e
Time: 2017-12-18
Author: donal.k.fellows@manchester.ac.uk
File Name: spynnaker/pyNN/external_devices_models/push_bot/push_bot_ethernet/push_bot_retina_connection.py
Class Name: PushBotRetinaConnection
Method Name: _receive_retina_data
Project Name: ilastik/ilastik
Commit Name: 88902a81605ff559ca60dd42c9aa67b93b34c9fd
Time: 2014-06-11
Author: bergs@janelia.hhmi.org
File Name: lazyflow/operators/opArrayCache.py
Class Name: OpArrayCache
Method Name: setInSlot
Project Name: Maluuba/nlg-eval
Commit Name: 9bfbbf636fb2a6184d470462545ad3868b1a8fc6
Time: 2018-07-03
Author: haschulz@microsoft.com
File Name: nlgeval/pycocoevalcap/meteor/meteor.py
Class Name: Meteor
Method Name: compute_score