Best Python code snippet using autotest_python
_engine.py
Source:_engine.py
...182 if event.exposure is not None:183 self._mmc.setExposure(event.exposure)184 if waitForSystem:185 self._mmc.waitForSystem()186 def _finish_run(self, sequence: MDASequence):187 """188 To be called at the end of an acquisition.189 Parameters190 ----------191 sequence : MDASequence192 The sequence that was finished.193 """194 logger.info("MDA Finished: {}", sequence)195 self._running = False196 self._events.sequenceFinished.emit(sequence)197 def run(self, sequence: MDASequence) -> None:198 """199 Run the multi-dimensional acquistion defined by `sequence`.200 Most users should not use this directly as it will block further201 execution. Instead use ``run_mda`` on CMMCorePlus which will run on202 a thread.203 Parameters204 ----------205 sequence : MDASequence206 The sequence of events to run.207 """208 try:209 self._prepare_to_run(sequence)210 for event in sequence:211 cancelled = self._wait_until_event(event, sequence)212 # If cancelled break out of the loop213 if cancelled:214 break215 logger.debug(event)216 self._prep_hardware(event)217 self._mmc.snapImage()218 img = self._mmc.getImage()219 with contextlib.suppress(EmitLoopError):220 self._events.frameReady.emit(img, event)221 except Exception as e: # noqa E722222 # clean up so future MDAs can be run223 self._canceled = False224 self._running = False225 with contextlib.suppress(Exception):226 self._finish_run(sequence)227 raise e...
reactor.py
Source:reactor.py
...55 def __init__(self, neopixels):56 self._pixels = neopixels57 self._running = False58 def boom(self):59 def _finish_run(self):60 self._running = False61 if self._running:62 return63 self._running = True64 self._boom_script().add_step(lambda: _finish_run(self)).execute()65 def _boom_script(self):66 s = Script()67 s.add_step(lambda: self._pixels.set_source(explosion_now(self._pixels.size(), stereo=[0, 1])))68 s.add_sleep(6)...
__init__.py
Source:__init__.py
1from . import backend_types2from ._finish_run import finish_run3from ._wes_backend import WESBackend4__all__ = [5 "backend_types",6 "finish_run",7 "WESBackend",...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!