def check_is_a_mapping(var, allow_none=False):
    """ Calls is_a_mapping and raises a type error if the check fails.
    """
    if not is_a_mapping(var, allow_none=allow_none):
        raise TypeError("var must be a dict, however type(var) is {}"
                        .format(type(var)))
def check_is_a_mapping ( var , allow_none = False ) : if not is_a_mapping ( var , allow_none = allow_none ) : raise TypeError ( "var must be a dict, however type(var) is {}" . format ( type ( var ) ) )
Calls is_a_mapping and raises a type error if the check fails.