code: 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
  
imports: from __future__ import division
  import sys
  import math
  import numpy
  import re
  from .pycm_param import *
  from .pycm_error import pycmMatrixError
  from warnings import warn
  from functools import wraps
label_desc: Use image node_id 4 for calling a global function with example usage: class_filter(classes, class_name) and returns: result_classes