code: def test_detect_low_cardinality_int():
      rng = np.random.RandomState(42)
      df_all = pd.DataFrame(
          {
              "binary_int": rng.randint(0, 2, size=1000),
              "categorical_int": rng.randint(0, 4, size=1000),
              "low_card_int_uniform": rng.randint(0, 20, size=1000),
              "low_card_int_binomial": rng.binomial(20, 0.3, size=1000),
              "cont_int": np.repeat(np.arange(500), 2),
          }
      )
  
      res = detect_types(df_all)
      types = res.T.idxmax()
      # This is duplicated from a preprocessing test, but let's make sure this behavior is as expected
      assert types["binary_int"] == "categorical"
      assert types["categorical_int"] == "categorical"
      assert types["low_card_int_uniform"] == "low_card_int_categorical"
      assert types["low_card_int_binomial"] == "low_card_int_ordinal"
      assert types["cont_int"] == "continuous"
      classification_plots = plot(
          df_all, target_col="binary_int", plot_pairwise=False
      )
      assert len(classification_plots) == 3
      # scatter matrix of two continuous features
      assert (
          classification_plots[1][0][0, 0].get_ylabel()
          == "low_card_int_binomial"
      )
      assert classification_plots[1][0][1, 0].get_ylabel() == "cont_int"
      assert classification_plots[2].shape == (1, 2)
      assert (
          classification_plots[2][0, 0].get_title()
          == "low_card_int_uniform"
      )
      assert (
          classification_plots[2][0, 1].get_title() == "categorical_int"
      )
  
      regression_plots = plot(df_all, target_col="cont_int")
      assert len(regression_plots) == 3
      assert regression_plots[1].shape == (1, 1)
      assert (
          regression_plots[1][0, 0].get_xlabel()
          == "low_card_int_binomial (jittered)"
      )
      assert regression_plots[2].shape == (1, 3)
      assert regression_plots[2][0, 0].get_ylabel() == "binary_int"
      assert regression_plots[2][0, 1].get_ylabel() == "categorical_int"
      assert (
          regression_plots[2][0, 2].get_ylabel()
          == "low_card_int_uniform"
      )
  
imports: import pytest
  import numpy
  import pandas
  import matplotlib.pyplot
  import warnings
  import itertools
  from sklearn.datasets import make_regression, make_blobs, load_digits, fetch_openml, load_diabetes
  from sklearn.preprocessing import KBinsDiscretizer
  from dabl.preprocessing import clean, detect_types, guess_ordinal
  from dabl.plot.supervised import plot, plot_classification_categorical, plot_classification_continuous, plot_regression_categorical, plot_regression_continuous
  from dabl.utils import data_df_from_bunch
  from dabl import set_config
label_desc: Use image node_id 13 for calling a global function with example usage: test_detect_low_cardinality_int() without return types