Best Python code snippet using fMBT_python
qserv-admin.py
Source:qserv-admin.py
...359 if not chunkIdStr.isdigit():360 raise _IllegalCommandError("Invalid argument '{0}', should be a chunk number".format(chunkIdStr))361 chunkId = int(chunkIdStr)362 self._css.deleteChunk(dbName, tbName, chunkId)363 def _parseDump(self, tokens):364 """365 Subparser, handle all DUMP requests.366 """367 if len(tokens) > 2:368 raise _IllegalCommandError("unexpected number of arguments")369 key = ""370 if len(tokens) > 0:371 if tokens[0].upper() != 'EVERYTHING':372 key = tokens[0]373 if len(tokens) == 2:374 # this may throw375 dest = open(tokens[1], 'w')376 else:377 dest = sys.stdout...
rom.py
Source:rom.py
...71 for i, sentence in enumerate(self.sentences):72 dump += sentence.text + "\n"73 return dump74 def reinsert(self, dump: str) -> None:75 sentences = self._parseDump(dump)76 # Expand to 4MB to free up 1MB.77 self.expand(0x400000)78 heap = Heap(self)79 heap.addFreeArea(RELOCATED_TEXT, RELOCATED_TEXT + 0x100000)80 # Reinsert dialogue and recompute pointers.81 for i, sentence in enumerate(sentences):82 pointer = heap.allocate(len(sentence))83 self.write(pointer, sentence)84 self.writeAddress(POINTERS + i * 3, pointer)85 self.save()86 self.assemble(asm_path("text.asm"))87 self.assemble(asm_path("font.asm"))88 self.assemble(asm_path("thousands_separator.asm"))89 def _parseDump(self, dump: str) -> List[List[int]]:90 matches = re.findall(r"((?:.*?)<End>)\n", dump, re.DOTALL)91 assert len(matches) == N_SENTENCES92 sentences = []93 for match in matches:94 sentence = unformat(match)95 sentences.append(sentence)...
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!!