code: def ks_score(mod, data, y):
      with local_context(
          datatable_disabled=True, polars_disabled=True
      ):  # conversion h2o frame to pandas using single thread as before
          from scipy.stats import ks_2samp
  
          df = pd.DataFrame()
          df["label"] = data[y].as_data_frame().iloc[:, 0]
          df["probs"] = (
              mod.predict(data)["p1"].as_data_frame().iloc[:, 0]
          )
  
          label_0 = df[df["label"] == 0]
          label_1 = df[df["label"] == 1]
  
          ks = ks_2samp(label_0["probs"], label_1["probs"])
  
          return ks.statistic
  
file_path: h2o-3/h2o-py/tests/testdir_misc/pyunit_gainslift_bins.py
imports: import sys
  import h2o
  import pandas
  from tests import pyunit_utils
  from h2o.estimators import *
  from h2o.utils.threading import local_context
label_desc: Use image node_id 2 for calling a global function with example usage: ks_score(mod, data, y) and returns: ks