code: def test_explanation_timeseries():
      train = h2o.upload_file(
          pyunit_utils.locate(
              "smalldata/timeSeries/CreditCard-ts_train.csv"
          )
      )
      x = [
          "MONTH",
          "LIMIT_BAL",
          "SEX",
          "EDUCATION",
          "MARRIAGE",
          "AGE",
          "PAY_STATUS",
          "PAY_AMT",
          "BILL_AMT",
      ]
      y = "DEFAULT_PAYMENT_NEXT_MONTH"
  
      # Make sure it works with missing values as well
      train[[5, 7, 11, 13, 17], "MONTH"] = float("nan")
  
      cols_to_test = []
      for col, typ in train.types.items():
          for ctt in cols_to_test:
              if typ == train.types[ctt] or col == y:
                  break
          else:
              cols_to_test.append(col)
  
      gbm = H2OGradientBoostingEstimator()
      gbm.train(x, y, training_frame=train)
  
      # test shap summary
      assert isinstance(
          gbm.shap_summary_plot(train).figure(),
          matplotlib.pyplot.Figure,
      )
      matplotlib.pyplot.close()
  
      # test shap explain row
      assert isinstance(
          gbm.shap_explain_row_plot(train, 1).figure(),
          matplotlib.pyplot.Figure,
      )
      matplotlib.pyplot.close()
  
      # test residual analysis
      assert isinstance(
          gbm.residual_analysis_plot(train).figure(),
          matplotlib.pyplot.Figure,
      )
      matplotlib.pyplot.close()
  
      # test pd_plot
      for col in cols_to_test:
          assert isinstance(
              gbm.pd_plot(train, col).figure(), matplotlib.pyplot.Figure
          )
  
      # test ICE plot
      for col in cols_to_test:
          assert isinstance(
              gbm.ice_plot(train, col).figure(),
              matplotlib.pyplot.Figure,
          )
      matplotlib.pyplot.close("all")
  
      # test explain
      assert isinstance(
          gbm.explain(train, render=False), H2OExplanation
      )
  
      # test explain row
      assert isinstance(
          gbm.explain_row(train, 1, render=False), H2OExplanation
      )
  
imports: import os
  import sys
  import pandas
  from h2o.grid import H2OGridSearch
  import matplotlib
  import h2o
  import pandas
  import matplotlib.pyplot
  from tests import pyunit_utils, test_plot_result_saving
  from h2o.automl import H2OAutoML
  from h2o.estimators import *
  from h2o.explanation._explain import H2OExplanation
label_desc: Use image node_id 13 for calling a global function with example usage: test_explanation_timeseries() without return types