code: def classes_filter(actual_vector, predict_vector, classes=None):
      """
      Return updated vectors and classes list.
  
      :param actual_vector: actual values
      :type actual_vector: list
      :param predict_vector: vector of predictions
      :type predict_vector: list
      :param classes: ordered labels of classes
      :type classes: list
      :return: [actual_vector, predict_vector, classes_list]
      """
      classes_list = set(actual_vector).union(set(predict_vector))
      if len(classes_list) == 1:
          classes_list.add("~other~")
      classes_list = sorted(classes_list)
      if isinstance(classes, list):
          if len(classes) == 0:
              return [actual_vector, predict_vector, classes]
          classes, _ = vector_filter(classes, [])
          classes_from_vectors = classes_list
          if isinstance(actual_vector[0], str) and not isinstance(
              classes[0], str
          ):
              classes = list(map(str, classes))
          elif isinstance(classes[0], str) and not isinstance(
              actual_vector[0], str
          ):
              actual_vector = list(map(str, actual_vector))
              predict_vector = list(map(str, predict_vector))
              classes_from_vectors = set(actual_vector).union(
                  set(predict_vector)
              )
          if not set(classes).issubset(classes_from_vectors):
              warn(CLASSES_WARNING, RuntimeWarning)
          classes_list = classes
      elif classes is not None:
          warn(CLASSES_TYPE_WARNING, RuntimeWarning)
      return [actual_vector, predict_vector, classes_list]
  
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 17 for calling a global function with example usage: classes_filter(actual_vector, predict_vector, classes) and returns: list, list