code: def cvxopt_matrix(M):
      if type(M) is ndarray:
          return matrix(M)
      elif type(M) is spmatrix or type(M) is matrix:
          return M
      coo = M.tocoo()
      return spmatrix(
          coo.data.tolist(),
          coo.row.tolist(),
          coo.col.tolist(),
          size=M.shape,
      )
  
file_path: explainx/lib/PDASH_utils.py
imports: from __future__ import print_function
  import numpy
  from sklearn.preprocessing import OneHotEncoder
  from cvxopt.solvers import qp
  from cvxopt import matrix, spmatrix
  from numpy import array, ndarray
  from scipy.spatial.distance import cdist
label_desc: Use image node_id 1 for calling a global function with example usage: cvxopt_matrix(M) and returns: spmatrix, matrix, M