code: def asserts(y_true, y_pred, cm):
      df = cm.to_dataframe()
      a = cm.to_array()
  
      df_with_sum = cm.to_dataframe(calc_sum=True)
  
      assert len(y_true) == len(y_pred)
  
      assert isinstance(df, pd.DataFrame)
      assert isinstance(a, np.ndarray)
      assert isinstance(df_with_sum, pd.DataFrame)
  
      N = len(df.index)
      assert N == len(df.columns)
      assert cm.len() == len(df.columns)
  
      assert df.index.name == "Actual"
      assert df.columns.name == "Predicted"
  
      assert df_with_sum.index.name == "Actual"
      assert df_with_sum.columns.name == "Predicted"
  
      # np.testing.assert_array_equal(confusion_matrix(y_true, y_pred), cm.toarray())
  
      assert cm.sum() == len(y_true)
  
      assert cm.true.name == "Actual"
      assert cm.pred.name == "Predicted"
  
imports: import pytest
  import matplotlib
  import numpy
  import pandas
  import pandas_ml.util.testing
  import pandas_ml
  from pandas_ml import ConfusionMatrix
  from collections import OrderedDict
label_desc: Use image node_id 1 for calling a global function with example usage: asserts(y_true, y_pred, cm) without return types