code: def test_trainer(trainer_params):
      (
          x_train,
          y_train,
          dataset,
          loss_fn_kwargs,
          preprocess,
          verbose,
      ) = trainer_params
      if dataset is not None and y_train is not None:
          ds = dataset(x_train, y_train)
      else:
          ds = None
      trainer(
          model,
          categorical_crossentropy,
          x_train,
          y_train=y_train,
          dataset=ds,
          loss_fn_kwargs=loss_fn_kwargs,
          preprocess_fn=preprocess,
          epochs=2,
          verbose=verbose,
      )
      assert (model.weights[0].numpy() != check_model_weights).any()
  
file_path: alibi-detect/alibi_detect/models/tensorflow/tests/test_trainer_tf.py
imports: from functools import partial
  from itertools import product
  import numpy
  import pytest
  import tensorflow
  from tensorflow.keras.losses import categorical_crossentropy
  from alibi_detect.models.tensorflow.trainer import trainer
  from alibi_detect.utils.tensorflow.data import TFDataset
label_desc: Use image node_id 3 for calling a global function with example usage: test_trainer(trainer_params) without return types