def _assert_type(element, types, name, clazz):
    """
    Utility to help assert types are only as expected.

    :param element: The element being checked
    :param types: The allowed types
    :param name: The name of the element
    :param clazz: The class containing the element
    :type element: Any
    :type types: Iterable[Any]
    :type name: str
    :type clazz: class
    :return: None
    """
    assert isinstance(types, tuple)
    assert isinstance(name, str)
    if element is not None:
        assert isinstance(element, types
            ), 'Incorrect type ({}) for {}.{}, [{}]'.format(type(element),
            clazz.__qualname__, name, types)
