code: def __curve_thresholds_handler__(curve, thresholds):
      """
      Handle conditions for thresholds.
  
      :param curve: curve
      :type curve: pycm.Curve object
      :param thresholds: thresholds list
      :type thresholds: list or numpy array
      :return: None
      """
      if thresholds is None:
          curve.thresholds = thresholds_calc(curve.probs)
      else:
          if not isinstance(thresholds, (list, numpy.ndarray)):
              raise pycmCurveError(THRESHOLDS_TYPE_ERROR)
          if len(thresholds) < 2:
              raise pycmCurveError(THRESHOLDS_NUMBER_ERROR)
          if not all(map(isfloat, thresholds)):
              raise pycmCurveError(THRESHOLDS_NUMERIC_ERROR)
          curve.thresholds = thresholds
          if isinstance(curve.thresholds, numpy.ndarray):
              curve.thresholds = curve.thresholds.tolist()
          curve.thresholds = sorted(curve.thresholds)
  
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 4 for calling a global function with example usage: __curve_thresholds_handler__(curve, thresholds) without return types