def dic_value(input_dic, key, default=None):
    """
    Returns the value from the dic. If input_dic is not a dict, or there is no such key, then returns default
    """
    if isinstance(input_dic, dict):
        value = input_dic.get(key, default)
    else:
        value = default
    return value