code: def calc_acc(
      X_train,
      y_train,
      X_test,
      y_test,
      max_iter,
      tol,
      means,
      covariances,
  ):
      xp = cupy.get_array_module(X_train)
      inv_cov, means, weights, cov = train_gmm(
          X_train, max_iter, tol, means, covariances
      )
      y_train_pred = predict(X_train, inv_cov, means, weights)
      train_accuracy = xp.mean(y_train_pred == y_train) * 100
      y_test_pred = predict(X_test, inv_cov, means, weights)
      test_accuracy = xp.mean(y_test_pred == y_test) * 100
      print("train_accuracy : %f" % train_accuracy)
      print("test_accuracy : %f" % test_accuracy)
      return y_test_pred, means, cov
  
file_path: cupy/examples/gmm/gmm.py
imports: import argparse
  import contextlib
  import time
  import matplotlib.pyplot
  import numpy
  from scipy import stats
  import cupy
label_desc: Use image node_id 7 for calling a global function with example usage: calc_acc(X_train, y_train, X_test, y_test, max_iter, tol, means, covariances) and returns: y_test_pred,  means,  cov