Best Python code snippet using autotest_python
expansion.py
Source: expansion.py
...151 return len(self.queue) == 0152 def reservable(self, node: ReservationNode) -> bool:153 reservation = self.reservations.get(node)154 return reservation is None or reservation.agent == self.id155def postprocess_iteration(lvl: Level, paths: List[List[int]], debug: bool) -> List[List[int]]:156 """Makes agents trying to move into occupied vertices wait for another turn and resolve deadlocks."""157 reservations = ReservationGraph(lvl.g)158 agents: List[FlowAgent] = []159 for i, path in enumerate(paths):160 agents.append(FlowAgent(lvl, reservations, agents, i, path, debug))161 i = 0162 while any(map(lambda a: not a.done(), agents)):163 for agent in agents:164 agent.step()165 return [agent.path for agent in agents]166def postprocess_paths(lvl: Level, paths: List[List[int]], debug: bool) -> List[List[int]]:167 """Repeatedly postprocess deduplicated paths to get valid MAE paths shorter than from a single postprocess_iteration"""168 i = 1169 while True:170 if debug:171 print(f"Postprocessing iteration {i}", file=stderr)172 dedup = [list(map(lambda t: t[0], groupby(path))) for path in paths]173 new_paths = postprocess_iteration(lvl, dedup, debug)174 if debug:175 for j, path in enumerate(new_paths):176 print(f"{j}: {' '.join(map(str, path))}", file=stderr)177 if new_paths == paths:178 break179 paths = new_paths180 i += 1181 return paths182class Solution(NamedTuple):183 flow: int184 flow_dict: Dict185 node_ids: List[Tuple[Dict[int, int], Dict[int, int]]]186 t: int187def evacuation_paths(lvl: Level, debug) -> List[List[int]]:...
example.py
Source: example.py
...43 """44 super(example, self).run_once() # Prints out basic info45 # Do Something useful here, store results in 'stuff'46 self.stuff['dc'] = 'DockerCmd(...)'47 def postprocess_iteration(self):48 """49 Called to process each iteration of run_once()50 """51 super(example, self).postprocess_iteration() # Prints out basic info52 # Do Something useful here, check 'stuff' for iteration-errors53 self.stuff['postprocess_iteration'] = 'nobody ever uses this'54 def postprocess(self):55 """56 Called to process all results after all postprocess_iteration()'s57 """58 super(example, self).postprocess() # Prints out basic info59 # Do Something useful here, check 'stuff' for overall errors60 self.stuff['postprocess'] = 'this is where you check results'61 def cleanup(self):62 """63 Always called, after all other methods64 """65 super(example, self).cleanup() # Prints out basic info66 # Do Something useful here, leave environment as we received it...
ceph_dbench.py
Source: ceph_dbench.py
...19 tag=self.generate_tag_for_subjob(client_id=id_),20 )21 shutil.rmtree(client_dir)22 print 'ceph dbench test ok'23 def postprocess_iteration(self):24 for id_ in skeleton.roles_of_type(self.my_roles, 'client'):25 self.copy_subjob_results_kv(26 client_id=id_,27 subjob_name='dbench',...
Check out the latest blogs from LambdaTest on this topic:
Before we discuss Scala testing, let us understand the fundamentals of Scala and how this programming language is a preferred choice for your development requirements.The popularity and usage of Scala are rapidly rising, evident by the ever-increasing open positions for Scala developers.
So, now that the first installment of this two fold article has been published (hence you might have an idea of what Agile Testing is not in my opinion), I’ve started feeling the pressure to explain what Agile Testing actually means to me.
Did you know that according to Statista, the number of smartphone users will reach 18.22 billion by 2025? Let’s face it, digital transformation is skyrocketing and will continue to do so. This swamps the mobile app development market with various options and gives rise to the need for the best mobile app testing tools
As a developer, checking the cross browser compatibility of your CSS properties is of utmost importance when building your website. I have often found myself excited to use a CSS feature only to discover that it’s still not supported on all browsers. Even if it is supported, the feature might be experimental and not work consistently across all browsers. Ask any front-end developer about using a CSS feature whose support is still in the experimental phase in most prominent web browsers. ????
The count of mobile users is on a steep rise. According to the research, by 2025, it is expected to reach 7.49 billion users worldwide. 70% of all US digital media time comes from mobile apps, and to your surprise, the average smartphone owner uses ten apps per day and 30 apps each month.
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!!