def is_seq_of(seq, item_type, seq_type=(list, tuple)):
    """
    Check whether it is a sequence of some type.

    Args:
        seq (Sequence): The sequence to be checked.
        item_type (tuple[type] | type): Expected item type.
        seq_type (tuple[type] | type, optional): Expected sequence type.
            Default: ``(list, tuple)``.

    Returns:
        bool: Whether the sequence is valid.
    """
    if not isinstance(seq, seq_type):
        return False

    for item in seq:
        if not isinstance(item, item_type):
            return False

    return True