def class_filter(classes, class_name):
    """
    Filter classes by comparing two lists.

    :param classes: confusion matrix classes
    :type classes: list
    :param class_name: subset of classes list
    :type class_name: list
    :return: filtered classes as list
    """
    result_classes = classes
    if isinstance(class_name, list):
        if set(class_name) <= set(classes):
            result_classes = class_name
    return result_classes