def _update_dict()

in src/slurm_plugin/instance_manager.py [0:0]


    def _update_dict(self, target_dict: dict, update: dict) -> dict:
        logger.debug("Updating target dict (%s) with update (%s)", target_dict, update)
        for update_key, update_value in update.items():
            if isinstance(update_value, dict):
                target_dict[update_key] = self._update_dict(target_dict.get(update_key, {}), update_value)
            elif isinstance(update_value, list):
                target_dict[update_key] = target_dict.get(update_key, []) + update_value
            elif isinstance(update_value, set):
                target_dict[update_key] = target_dict.get(update_key, set()) | update_value
            else:
                target_dict[update_key] = update_value
        logger.debug("Updated target dict is (%s)", target_dict)
        return target_dict