code: def test_clfuncdrift(clfuncdrift_params):
      (
          p_val,
          backend,
          n_features,
          n_labels,
          preds_type,
          uncertainty_type,
          update_x_ref,
          to_list,
      ) = clfuncdrift_params
  
      np.random.seed(0)
      tf.random.set_seed(0)
  
      model = gen_model(
          n_features, n_labels, backend, preds_type == "probs"
      )
      x_ref = np.random.randn(*(n, n_features)).astype(np.float32)
      x_test0 = x_ref.copy()
      x_test1 = np.ones_like(x_ref)
  
      if to_list:
          x_ref = [x[None, :] for x in x_ref]
          x_test0 = [x[None, :] for x in x_test0]
          x_test1 = [x[None, :] for x in x_test1]
  
      cd = ClassifierUncertaintyDrift(
          x_ref=x_ref,
          model=model,
          p_val=p_val,
          backend=backend,
          update_x_ref=update_x_ref,
          preds_type=preds_type,
          uncertainty_type=uncertainty_type,
          margin_width=0.1,
          batch_size=10,
          preprocess_batch_fn=partial(id_fn, to_pt=backend == "pytorch")
          if to_list
          else None,
      )
  
      preds_0 = cd.predict(x_test0)
      assert cd._detector.n == len(x_test0) + len(x_ref)
      assert preds_0["data"]["is_drift"] == 0
      assert preds_0["data"]["distance"] >= 0
  
      preds_1 = cd.predict(x_test1)
      assert cd._detector.n == len(x_test1) + len(x_test0) + len(x_ref)
      assert preds_1["data"]["is_drift"] == 1
      assert preds_1["data"]["distance"] >= 0
      assert preds_0["data"]["distance"] < preds_1["data"]["distance"]
  
imports: import numpy
  import pytest
  from functools import partial
  from itertools import product
  import scipy
  import tensorflow
  from tensorflow.keras.layers import Dense, Input, Softmax, Dropout
  import torch
  import torch.nn
  from typing import Union
  from alibi_detect.cd import ClassifierUncertaintyDrift, RegressorUncertaintyDrift
label_desc: Use image node_id 6 for calling a global function with example usage: test_clfuncdrift(clfuncdrift_params) without return types