code: def __obj_vector_handler__(
      cm,
      actual_vector,
      predict_vector,
      threshold,
      sample_weight,
      classes,
  ):
      """
      Handle object conditions for vectors.
  
      :param cm: confusion matrix
      :type cm: pycm.ConfusionMatrix object
      :param actual_vector: actual vector
      :type actual_vector: python list or numpy array of any stringable objects
      :param predict_vector: vector of predictions
      :type predict_vector: python list or numpy array of any stringable objects
      :param threshold: activation threshold function
      :type threshold: FunctionType (function or lambda)
      :param sample_weight: sample weights list
      :type sample_weight: list
      :param classes: ordered labels of classes
      :type classes: list
      :return: matrix parameters as list
      """
      if isinstance(threshold, types.FunctionType):
          cm.prob_vector = predict_vector
          predict_vector = list(map(threshold, predict_vector))
          cm.predict_vector = predict_vector
      if not isinstance(
          actual_vector, (list, numpy.ndarray)
      ) or not isinstance(predict_vector, (list, numpy.ndarray)):
          raise pycmVectorError(VECTOR_TYPE_ERROR)
      if len(actual_vector) != len(predict_vector):
          raise pycmVectorError(VECTOR_SIZE_ERROR)
      if len(actual_vector) == 0 or len(predict_vector) == 0:
          raise pycmVectorError(VECTOR_EMPTY_ERROR)
      if classes is not None and len(set(classes)) != len(classes):
          raise pycmVectorError(VECTOR_UNIQUE_CLASS_ERROR)
      matrix_param = matrix_params_calc(
          actual_vector, predict_vector, sample_weight, classes
      )
      if isinstance(sample_weight, (list, numpy.ndarray)):
          cm.weights = sample_weight
  
      return matrix_param
  
file_path: pycm/pycm/pycm_handler.py
imports: from __future__ import division
  from .pycm_class_func import class_statistics
  from .pycm_error import pycmVectorError, pycmMatrixError
  from .pycm_overall_func import overall_statistics
  from .pycm_util import *
  from .pycm_param import *
  import json
  import types
  import numpy
label_desc: Use image node_id 8 for calling a global function with example usage: __obj_vector_handler__(cm, actual_vector, predict_vector, threshold, sample_weight, classes) and returns: matrix_param