code: def data_generator():
      """
      Generate datasets with appropriate labellings.
  
      Some data can not be represented by some data types, so then you
      need to provide excemption_data_types as a third tuple element. Then,
      we can skip testcases that try this.
  
      Yields
      ------
      (data, distribution type, excemption_data_types[optional]) : tuple
          data should be a list, distribution type either 'binary',
          'category' or 'continuous', and excemption_data_types a list
          or data structure classes.
      """
      # NOTE: we comment out mixed-type lists, as this is just weird.
      yield [0, 1, 0, 0, 1], "binary"
      yield ["hi", "person", "hi", "hi"], "binary"
      # yield [1, "hey", "hey", 1], 'binary', [asarray, Series, DataFrame]
      # yield [2.1, "hey", "hey", 2.1], 'binary', [asarray, Series, DataFrame]
      yield [3, 2], "binary"
      yield [3, 2, 0, 1, 2, 5], "category"
      yield ["USA", "NL", "GB", "NL"], "category"
      # yield [1, "hey", 4, "bye"], 'category', [asarray, Series, DataFrame]
      yield [[0, 0, 1], [0, 1, 0], [0, 0, 1], [1, 0, 0]], "category", [
          Series
      ]
      yield [1, 2, 6, 2, 1.1], "continuous"
      yield [0.1, 2.0, 0.999999, 100000.1], "continuous"
      yield [[5.5, 12.2], [86.2, 81.1]], "continuous", [Series]
      yield [[0, 1], [1, 0], [0.1, 2]], "continuous", [Series]
  
      # Larger examples.
      X, y = fetch_adult(return_X_y=True)
      yield y.tolist(), "binary"
      non_NaN_rows = ~X.isna().any(axis=1)
      X = X[non_NaN_rows]
      yield X["native-country"].tolist(), "category"
      yield X["sex"].tolist(), "binary"
  
imports: from fairlearn.adversarial._preprocessor import FloatTransformer
  import pytest
  from pandas import DataFrame, Series
  from numpy import ndarray, asarray, issubdtype
  from fairlearn.datasets import fetch_adult
label_desc: Use image node_id 1 for calling a global function with example usage: data_generator() without return types