code: def validate_matrix(matrix, exp_total_count, exp_total_false_count):
      assert MATRIX in matrix
      assert CATEGORY1 in matrix
      assert CATEGORY2 in matrix
      num_cat1 = len(matrix[CATEGORY1][VALUES])
      num_cat2 = len(matrix[CATEGORY2][VALUES])
      assert len(matrix[MATRIX]) == num_cat1
      assert len(matrix[MATRIX][0]) == num_cat2
      # take sum of count, false count
      total_count = 0
      total_false_count = 0
      for i in range(num_cat1):
          for j in range(num_cat2):
              total_count += matrix[MATRIX][i][j][COUNT]
              total_false_count += matrix[MATRIX][i][j][FALSE_COUNT]
      assert exp_total_count == total_count
      assert exp_total_false_count == total_false_count
  
file_path: responsible-ai-toolbox/responsibleai/tests/error_analysis_validator.py
imports: import pytest
  from erroranalysis._internal.matrix_filter import CATEGORY1, CATEGORY2, COUNT, FALSE_COUNT, MATRIX, VALUES
  from raiutils.exceptions import UserConfigValidationException
  from responsibleai._internal.constants import ErrorAnalysisManagerKeys
  from responsibleai.exceptions import DuplicateManagerConfigException
label_desc: Use image node_id 3 for calling a global function with example usage: validate_matrix(matrix, exp_total_count, exp_total_false_count) without return types