code: def runtime(X, y, model_generator, method_name):
      old_seed = np.random.seed()
      np.random.seed(3293)
      method_reps = []
      for i in range(1):
          X_train, X_test, y_train, _ = train_test_split(__toarray(X), y, test_size=100, random_state=i)
          model = model_generator()
          model.fit(X_train, y_train)
          start = time.time()
          explainer = getattr(methods, method_name)(model, X_train)
          build_time = time.time() - start
          start = time.time()
          explainer(X_test)
          explain_time = time.time() - start
          method_reps.append(build_time + explain_time * 1000.0 / X_test.shape[0])
      np.random.seed(old_seed)
      return None, np.mean(method_reps)