def _none_dict(val, name, defaults={}):
    """

    False/None  ===>  None
    True/dict   ===>  dict
    otherwise   ===>  error

    """
    if val is False or val is None:
        return None
    if val is True:
        val = dict()
    if not isinstance(val, dict):
        raise ValueError("Unrecognized type '{}' for `{}`!".format(type(val
            ), name))
    for kk, vv in defaults.items():
        val.setdefault(kk, vv)
    return val
