in launcher/config_validator/value_validator.py [0:0]
def get_argument(config: DictConfig, argument_name: str):
"""
Return the value of given argument_name from config
Parameters:
config : Configuration dictionary
argument_name : The name of argument to fetch.
Returns:
bool: Argument if present else return None
argument_name can have a nested key like key1.key2 in which case we will return config[key1][key2].
If config[key1] is None for above case we will return None
"""
argument_name_splits = argument_name.split(".")
if len(argument_name_splits) > 1:
subconfig = config.get(argument_name_splits[0])
if subconfig is None:
return None
argument_name_splits.pop(0)
remaining_argument_name = ".".join(argument_name_splits)
return get_argument(subconfig, remaining_argument_name)
return config.get(argument_name)