Best Python code snippet using yandex-tank
validated_config.py
Source:validated_config.py
...33 core_section='core'34 ):35 if not isinstance(configs, list):36 configs = [configs]37 self.__raw_config_dict = self.__load_multiple(38 [config for config in configs if config is not None])39 if self.__raw_config_dict.get(core_section) is None:40 self.__raw_config_dict[core_section] = {}41 self.BASE_SCHEMA = load_yaml_schema(42 pkg_resources.resource_filename(43 package_schema_path, package_schema_file44 )45 )46 self.DYNAMIC_OPTIONS = dynamic_options47 self.CORE_SECTION = core_section48 self._validated = None49 self.with_dynamic_options = with_dynamic_options50 logger.debug('patched_raw_config_dict: %s', self.__raw_config_dict)51 def __load_multiple(self, configs):52 configs_count = len(configs)53 if configs_count == 0:54 return {}55 elif configs_count == 1:56 return configs[0]57 elif configs_count == 2:58 return recursive_dict_update(configs[0], configs[1])59 else:60 return self.__load_multiple(61 [recursive_dict_update(configs[0], configs[1])] + configs[2:])62 def get_option(self, section, option, default=None):63 try:64 self.validated[section][option]65 except KeyError:66 if default is not None:67 return default68 else:69 raise KeyError()70 return self.validated[section][option]71 def get_enabled_sections(self):72 return [73 section_name for section_name, section_config in self.__raw_config_dict.items()74 if section_config.get('enabled', False)...
MultiLoader.py
Source:MultiLoader.py
...12 'Adj close': np.float64,13 'Volume': np.int64,14 }15 def __init__(self, stock_files):16 self.data = self.__load_multiple(stock_files)17 self.stock_count = len(stock_files)18 def __load_multiple(self, stock_files):19 df_all = pd.DataFrame()20 for f in stock_files:21 df = pd.read_csv(f, dtype=self.dtypes, index_col=0)22 df.columns = pd.MultiIndex.from_tuples(23 [(c, f) for c in df.columns])24 df_all = pd.concat([df_all, df], axis=1, sort=True)25 # Supplements26 df_all.loc[:, ('Ommyo', f)] = df_all['Close'][f] - \27 df_all['Open'][f]28 df_all.loc[:, ('Ommyo rate', f)] = (29 df_all['Ommyo'][f]) / df_all['Close'][f]30 df_all.loc[:, ('Adj open', f)] = (df_all['Open'][f]) * \31 df_all['Adj close'][f] / df_all['Close'][f]32 df_all.loc[:, ('Adj high', f)] = (df_all['High'][f]) * \...
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!!