code: def _yield_datasets(model: Estimator):
      """Generates datasets for a given model."""
  
      from sklearn import datasets as sk_datasets
  
      from river import (
          base,
          compose,
          datasets,
          preprocessing,
          stream,
          utils,
      )
  
      # Recommendation models can be regressors or classifiers, but they have requirements as to the
      # structure of the data
      if isinstance(utils.inspect.extract_relevant(model), Ranker):
          if utils.inspect.isregressor(model):
              yield _DummyDataset(
                  ("Alice", "Superman", 8),
                  ("Alice", "Terminator", 9),
                  ("Alice", "Star Wars", 8),
                  ("Alice", "Notting Hill", 2),
                  ("Alice", "Harry Potter", 5),
                  ("Bob", "Superman", 8),
                  ("Bob", "Terminator", 9),
                  ("Bob", "Star Wars", 8),
                  ("Bob", "Notting Hill", 2),
              )
          return
  
      # Multi-output regression
      elif utils.inspect.ismoregressor(model):
          # 1
          yield stream.iter_sklearn_dataset(sk_datasets.load_linnerud())
  
          # 2
          class SolarFlare:
              """One-hot encoded version of `datasets.SolarFlare"""
  
              def __iter__(self):
                  oh = (
                      compose.SelectType(str)
                      | preprocessing.OneHotEncoder()
                  ) + compose.SelectType(int)
                  for x, y in datasets.SolarFlare().take(200):
                      yield oh.transform_one(x), y
  
          yield SolarFlare()
  
      # Regression
      elif utils.inspect.isregressor(model):
          yield datasets.TrumpApproval().take(200)
  
      # Multi-output classification
      if utils.inspect.ismoclassifier(model):
          yield datasets.Music().take(50)
  
      # Classification
      elif utils.inspect.isclassifier(model):
          yield datasets.Phishing().take(200)
          yield (
              (x, np.bool_(y)) for x, y in datasets.Phishing().take(200)
          )
  
          # Multi-class classification
          if model._multiclass and base.tags.POSITIVE_INPUT not in model._tags:  # type: ignore
              yield datasets.ImageSegments().take(200)
  
      # Anomaly detection
      elif utils.inspect.isanomalydetector(model):
          yield datasets.CreditCard().take(1000)
  
file_path: river/river/checks/__init__.py
imports: from __future__ import annotations
  import functools
  import typing
  import numpy
  from river.base import Estimator
  from river.model_selection.base import ModelSelector
  from river.reco.base import Ranker
  from .None import anomaly, clf, common, model_selection, reco
label_desc: Use image node_id 3 for calling a global function with example usage: _yield_datasets(model) without return types