def process_environment_settings(default_dictionary: dict, settings: typing.Optional[dict]=None,<EOL>presets: typing.Optional[dict]=None):
settings = settings if settings is not None else {}<EOL>presets = presets if presets is not None else {}<EOL>env_keys = sorted(set(default_dictionary.keys()) | set(presets.keys()))<EOL>result_dict = {}<EOL>for key in env_keys:<EOL><INDENT>if key in default_dictionary:<EOL><INDENT>new_dict = default_dictionary[key].copy()<EOL><DEDENT>else:<EOL><INDENT>new_dict = {}<EOL><DEDENT>new_dict.update(settings)<EOL>if key in presets:<EOL><INDENT>new_dict.update(presets[key])<EOL><DEDENT>result_dict[key] = new_dict<EOL><DEDENT>return result_dict<EOL>
Process a dictionary of env settings