code: def deep_shap(model, data):
      """Deep SHAP (DeepLIFT)"""
      if isinstance(model, KerasWrap):
          model = model.model
      explainer = DeepExplainer(model, kmeans(data, 1).data)
  
      def f(X):
          phi = explainer.shap_values(X)
          if isinstance(phi, list) and len(phi) == 1:
              return phi[0]
          else:
              return phi
  
      return f
  
imports: import numpy
  import sklearn
  from ..None import DeepExplainer, GradientExplainer, KernelExplainer, LinearExplainer, SamplingExplainer, TreeExplainer, kmeans
  from ..explainers import other
  from .models import KerasWrap
label_desc: Use image node_id 16 for calling a global function with example usage: deep_shap(model, data) and returns: f, phi, phi