code: def ai_test(self, df, y, model, model_name="xgboost", mode=None):
      y_variable = "y_actual"
      y_variable_predict = "y_prediction"
  
      prediction_col = []
  
      if model_name == "xgboost":
          import xgboost
  
          if xgboost.__version__ in [
              "1.1.0",
              "1.1.1",
              "1.1.0rc2",
              "1.1.0rc1",
          ]:
              print(
                  "Current Xgboost version is not supported. Please install Xgboost using 'pip install xgboost==1.0.2'"
              )
              return False
          prediction_col = model.predict(xgboost.DMatrix(df))
  
      elif model_name == "catboost":
          prediction_col = model.predict(df.to_numpy())
  
      else:
          prediction_col = model.predict(df.to_numpy())
  
      # is classification?
      is_classification = self.is_classification_given_y_array(
          prediction_col
      )
  
      # shap
      c = calculate_shap()
      self.df_final, self.explainer = c.find(
          model,
          df,
          prediction_col,
          is_classification,
          model_name=model_name,
      )
  
      # prediction col
      self.df_final[y_variable_predict] = prediction_col
  
      self.df_final[y_variable] = y
  
      # additional inputs.
      if is_classification == True:
          # find and add probabilities in the dataset.
          prediction_col_prob = model.predict_proba(df.to_numpy())
          pd_prediction_col_prob = pd.DataFrame(prediction_col_prob)
  
          for c in pd_prediction_col_prob.columns:
              self.df_final["Probability_" + str(c)] = list(
                  pd_prediction_col_prob[c]
              )
  
          classes = []
          for c in pd_prediction_col_prob.columns:
              classes.append(str(c))
          self.param["classes"] = classes
  
          try:
              expected_values_by_class = self.explainer.expected_value
          except:
              expected_values_by_class = []
              for c in range(len(classes)):
                  expected_values_by_class.append(1 / len(classes))
  
          self.param["expected_values"] = expected_values_by_class
      else:
          try:
              expected_values = self.explainer.expected_value
              self.param["expected_values"] = [expected_values]
          except:
              expected_value = [round(np.array(y).mean(), 2)]
              self.param["expected_values"] = expected_value
  
      self.param["is_classification"] = is_classification
      self.param["model_name"] = model_name
      self.param["model"] = model
      self.param["columns"] = df.columns
      self.param["y_variable"] = y_variable
      self.param["y_variable_predict"] = y_variable_predict
  
      # manually test all the graphs to see if all work
  
      g = plotly_graphs()
  
      __, df2 = g.feature_importance(self.df_final)
      fim, df2 = g.feature_impact(self.df_final)
      sp = g.summary_plot(self.df_final)
  
      return True
  
imports: import os
  import sys
  import re
  from pathlib import Path
  from sys import platform
  import subprocess
  import time
  from imports import *
  from dashboard import *
  from calculate_shap import *
  from analytics import Analytics
label_desc: Use image node_id 5 for calling the explain obj's underlying member method code with example usage: obj.ai_test(df, y, model, model_name, mode) and returns: True, False