code: def __curve_classes_handler__(curve, classes):
      """
      Handle conditions for curve classes.
  
      :param curve: curve
      :type curve: pycm.Curve object
      :param classes: ordered labels of classes
      :type classes: list
      :return: None
      """
      if not isinstance(classes, list):
          raise pycmCurveError(CLASSES_TYPE_ERROR)
      if len(set(classes)) != len(classes):
          raise pycmCurveError(VECTOR_UNIQUE_CLASS_ERROR)
      if set(classes) != set(curve.actual_vector):
          raise pycmCurveError(CLASSES_MATCH_ERROR)
      if len(classes) < 2:
          raise pycmCurveError(CLASS_NUMBER_ERROR)
      if set(map(len, curve.probs)) != {len(classes)}:
          raise pycmCurveError(PROBABILITY_SIZE_ERROR)
      if len(classes) == 2:
          curve.binary = True
      curve.classes = classes
      if len(set(map(type, curve.actual_vector))) > 1:
          curve.classes = list(map(str, curve.classes))
  
imports: from __future__ import division
  from .pycm_error import pycmCurveError, pycmPlotError
  from .pycm_util import threshold_func, thresholds_calc, isfloat
  from .pycm_param import *
  from .pycm_obj import ConfusionMatrix
  from warnings import warn
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: __curve_classes_handler__(curve, classes) without return types