def safe_get(mapping: dict, key, default=None):
    """
    :param mapping: dictionary of key values
    :param key: key being searched for
    :param default: default value in case key was not present in the dict
    :return: default value if the key is not present in the mapping dictionary, else the value in the dict for the key
    """
    if mapping is None or key not in mapping:
        return default
    return mapping[key]