code: def __obj_file_handler__(cm, file):
      """
      Handle object conditions for the input file.
  
      :param cm: confusion matrix
      :type cm: pycm.ConfusionMatrix object
      :param file: saved confusion matrix file object
      :type file: (io.IOBase & file)
      :return: matrix parameters as list
      """
      obj_data = json.load(file)
      if (
          obj_data["Actual-Vector"] is not None
          and obj_data["Predict-Vector"] is not None
      ):
          loaded_weights = obj_data.get("Sample-Weight", None)
          matrix_param = matrix_params_calc(
              obj_data["Actual-Vector"],
              obj_data["Predict-Vector"],
              loaded_weights,
          )
          cm.actual_vector = obj_data["Actual-Vector"]
          cm.predict_vector = obj_data["Predict-Vector"]
          cm.prob_vector = obj_data.get("Prob-Vector", None)
          cm.weights = loaded_weights
      else:
          try:
              loaded_transpose = obj_data["Transpose"]
          except Exception:
              loaded_transpose = False
          cm.transpose = loaded_transpose
          loaded_matrix = dict(obj_data["Matrix"])
          for i in loaded_matrix.keys():
              loaded_matrix[i] = dict(loaded_matrix[i])
          matrix_param = matrix_params_from_table(loaded_matrix)
      cm.digit = obj_data["Digit"]
      cm.imbalance = obj_data.get("Imbalanced", None)
  
      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 5 for calling a global function with example usage: __obj_file_handler__(cm, file) and returns: matrix_param