code: def check_pickling(model, dataset):
      from river import utils
  
      assert isinstance(
          pickle.loads(pickle.dumps(model)), model.__class__
      )
      for x, y in dataset:
          if utils.inspect.isanomalydetector(model):
              model.score_one(x)
              model.learn_one(x)
          else:
              model.predict_one(x)
              model.learn_one(x, y)
      assert isinstance(
          pickle.loads(pickle.dumps(model)), model.__class__
      )
  
imports: from __future__ import annotations
  import copy
  import inspect
  import pickle
  import random
  from .utils import assert_predictions_are_close, seed_params
label_desc: Use image node_id 6 for calling a global function with example usage: check_pickling(model, dataset) without return types