def check_list_type(l, t, ignore_none=False, param_name=''):
    """Checks if only the correct type is present in list values"""
    if ignore_none and l is None:
        return
    if any(map(lambda x: not isinstance(x, t), l)):
        raise ValueError("Param. '{}' must be filled with values of '{}'".
            format(param_name, t))
