Best Python code snippet using localstack_python
config.py
Source:config.py
...44 :type rc_setting: bool45 """46 if not Session2._isValidSession():47 # _TWCC_API_KEY_ priority higher then TWCC_API_KEY48 get_environment_params('TWCC_API_KEY', apikey)49 get_environment_params('_TWCC_API_KEY_', apikey)50 get_environment_params('TWCC_PROJ_CODE', proj_code)51 get_environment_params('_TWCC_PROJECT_CODE_', proj_code)52 get_environment_params('_TWCC_CLI_GA_', ga_flag)53 os.environ['User_Agent'] = user_agent54 cid = set_cid_flag(ga_flag)55 if check_empty_value(proj_code):56 proj_code = click.prompt(57 'Please enter TWCC Project Code', type=str)58 if isNone(apikey) or len(apikey) == 0:59 apikey = click.prompt('Please enter TWCC APIKEY', type=str)60 if validate(apikey):61 proj_code = proj_code.upper()62 if env.verbose:63 logger.info(64 "Receiving TWCC Project Code: {}".format(proj_code))65 logger.info("Receiving TWCC API Key: {}".format(apikey))66 logger.info("Receiving TWCC CLI GA: {}".format(ga_flag))...
dltk_environment.py
Source:dltk_environment.py
...63 return64 dltk_api.call("DELETE", "environments", {65 "name": name,66 }, return_entries=False)67def get_environment_params(connector_name=None, environment_name=None):68 options = {}69 if connector_name:70 options["connector"] = connector_name71 if environment_name:72 options["environment"] = environment_name73 return dltk_api.call(74 "GET",75 "environment_params",76 options77 )78def get_environment_param(param_name, connector_name=None, environment_name=None):79 params = get_environment_params(80 connector_name=connector_name,81 environment_name=environment_name82 )83 for p in params:84 if p["name"] == param_name:85 return p86 return None87def set_environment_params(params, connector_name=None, environment_name=None):88 dltk_api.call(89 "PUT",90 "environment_params",91 {92 **{93 "connector": connector_name,...
params_manager.py
Source:params_manager.py
...15 16 def get_agent_params(self):17 return self.params['agent']18 19 def get_environment_params(self):20 return self.params['environment']21 22 def update_agent_params(self, **kwargs):23 for key, value in kwargs.items():24 if key in self.get_agent_params().keys():25 self.params['agent'][key] = value26 27 def export_agent_params(self, file_name):28 with open(file_name, 'w') as f: 29 json.dump(self.params['agent'], f, indent=4, separators = (',', ':'), sort_keys=True)30 f.write("\n")31 32 def export_environment_params(self, file_name):33 with open(file_name, 'w') as f: 34 json.dump(self.params['environment'], f, indent=4, separators = (',', ':'), sort_keys=True)35 f.write("\n") 36 37 38 39if __name__ == "__main__":40 print("Probando nuestro manager de parámetros...")41 param_file = "../parameters.json"42 manager = ParamsManager(param_file)43 44 agent_params = manager.get_agent_params()45 print("Los parámetros del agente son: ")46 for key, value in agent_params.items():47 print(key, ": ", value)48 env_params = manager.get_environment_params()49 print("Los parámetros del entorno son: ")50 for key, value in env_params.items():51 print(key, ": ", value)52 53 54 manager.update_agent_params(learning_rate = 0.01, gamma = 0.92)55 agent_params_updated = manager.get_agent_params()56 print("Los parámetros del agente actualizados son: ")57 for key, value in agent_params_updated.items():58 print(key, ": ", value)59 60 print("Fin de la prueba")61 62 ...
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!!