def dict_get(dict, key, default=None):
    """
    Returns the value of key in the given dict, or the default value if
    the key is not found. 
    """
    if dict is None:
        return default
    return dict.get(key, default)