code: def assertMeanSDCalculation(meanCol, stdCol, cvVals, tol=1e-6):
      """
      For performance metrics calculated by cross-validation, we take the actual values and calculated the mean and
      variance manually.  Next we compare the two and make sure they are equal
  
      :param meanCol: mean values over all nfolds
      :param stdCol: std values over all nfolds
      :param cvVals: actual values over all nfolds
      :param tol: error tolerance
      :return: error if the two sets of values are different.
      """
      nfolds = len(cvVals)
      nItems = len(meanCol)
      oneOverNm1 = 1.0 / (nfolds - 1.0)
  
      for itemIndex in range(nItems):
          xsum = 0
          xsumSquare = 0
          for foldIndex in range(nfolds):
              temp = float(cvVals[foldIndex][itemIndex])
              xsum += temp
              xsumSquare += temp * temp
          xmean = xsum / nfolds
          assert (
              abs(xmean - float(meanCol[itemIndex])) < tol
          ), "Expected mean: {0}, Actual mean: {1}".format(
              xmean, float(meanCol[itemIndex])
          )
          xstd = math.sqrt(
              (xsumSquare - nfolds * xmean * xmean) * oneOverNm1
          )
          assert (
              abs(xstd - float(stdCol[itemIndex])) < tol
          ), "Expected SD: {0}, Actual SD: {1}".format(
              xstd, float(stdCol[itemIndex])
          )
  
imports: import sys
  import h2o
  from tests import pyunit_utils
  from h2o.estimators.gbm import H2OGradientBoostingEstimator
  import math
label_desc: Use image node_id 2 for calling a global function with example usage: assertMeanSDCalculation(meanCol, stdCol, cvVals, tol) without return types