def set_layer(layer_dict: dict, name: str, alternative): if name in layer_dict.keys(): return layer_dict[name] return alternative