Best Python code snippet using yandex-tank
reader.py
Source:reader.py
...39 except:40 key_group, key_name = key.split('_')[0], '_'.join(key.split('_')[1:])41 if key_group in decoder.diff_metrics.keys():42 if key_name in decoder.diff_metrics[key_group]:43 decoded_key = decoder.find_common_names(key)44 if self.prev_check:45 try:46 value = jsn[ts][key] - self.prev_check[key]47 except KeyError:48 logger.debug(49 'There is no diff value for metric %s.\n'50 'Timestamp: %s. Is it initial data?',51 key,52 ts,53 exc_info=True)54 value = 055 prepared_results[decoded_key] = value56 else:57 decoded_key = decoder.find_common_names(key)58 prepared_results[decoded_key] = value59 else:60 decoded_key = decoder.find_common_names(key)61 prepared_results[decoded_key] = value62 self.prev_check = jsn[ts]63 collect.append((ts, prepared_results))64 except ValueError:65 logger.error(66 'Telegraf agent send trash to output: %s', chunk)67 logger.debug(68 'Telegraf agent data block w/ trash: %s', exc_info=True)69 return []70 except:71 logger.error(72 'Exception trying to parse agent data: %s',73 chunk,74 exc_info=True)...
questao20.py
Source:questao20.py
...18lst_1 = ["microsoft", "blackberry", "cellcom", "apple", "orange", "google"]19lst_2 = ["apple", "banana", "blackberry", "orange", "peach"]202122def find_common_names(lst1, lst2): # lst2 sorted23 res = []2425 for i in lst1:26 if binary_search(lst2, i):27 res.append(i)28 return res29
...
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!!