code: def _get_max_cat_cardinality(n_samples, max_cat_cardinality="auto"):
      if max_cat_cardinality == "auto":
          max_cat_cardinality = max(42, n_samples / 100)
          if n_samples <= 42:
              # this is pretty hacky
              max_cat_cardinality = n_samples // 2
      return max_cat_cardinality
  
imports: from importlib.metadata import version
  from joblib import hash
  import warnings
  from warnings import warn
  import numpy
  import pandas
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.compose import make_column_transformer, ColumnTransformer
  from sklearn.impute import SimpleImputer
  from sklearn.pipeline import make_pipeline
  from sklearn.preprocessing import OneHotEncoder, StandardScaler
  from sklearn.utils.validation import check_is_fitted
label_desc: Use image node_id 7 for calling a global function with example usage: _get_max_cat_cardinality(n_samples, max_cat_cardinality) and returns: max_cat_cardinality