code: def is_categorical(
      column: pd.Series,
      max_categorical_ratio: float = 0.01,
      max_categories_type_string: int = 150,
      max_categories_type_int: int = 30,
      max_categories_type_float_or_datetime: int = 5,
  ) -> bool:
      """Check if uniques are few enough to count as categorical.
  
      Parameters
      ----------
      column : pd.Series
          A dataframe column
      max_categorical_ratio : float , default: 0.01
      max_categories_type_string : int , default: 150
      max_categories_type_int : int , default: 30
      max_categories_type_float_or_datetime : int , default: 5
  
      Returns
      -------
      bool
          True if is categorical according to input numbers
      """
      n_samples = len(column.dropna())
      if n_samples == 0:
          get_logger().warning(
              "Column %s only contains NaN values.", column.name
          )
          return False
  
      n_samples = np.max([n_samples, 1000])
      n_unique = column.nunique(dropna=True)
      col_type = get_column_type(column)
      if col_type == "string":
          max_categories = max_categories_type_string
      elif col_type == "float":
          # If all values are natural numbers, treat as int
          all_numbers_natural = (
              np.max(pd.to_numeric(column).dropna() % 1) == 0
          )
          max_categories = (
              max_categories_type_int
              if all_numbers_natural
              else max_categories_type_float_or_datetime
          )
      elif col_type == "time":
          max_categories = max_categories_type_float_or_datetime
      elif col_type == "int":
          max_categories = max_categories_type_int
      else:
          return False
  
      return (
          n_unique / n_samples
      ) < max_categorical_ratio and n_unique <= max_categories
  
file_path: deepchecks/deepchecks/utils/type_inference.py
imports: import typing
  import numpy
  import pandas
  from pandas.core.dtypes.common import is_datetime64_any_dtype, is_float_dtype, is_numeric_dtype
  from typing_extensions import Literal
  from deepchecks.utils.logger import get_logger
  from deepchecks.utils.typing import Hashable
  from deepchecks.utils.validation import ensure_hashable_or_mutable_sequence
label_desc: Use image node_id 3 for calling a global function with example usage: is_categorical(column, max_categorical_ratio, max_categories_type_string, max_categories_type_int, max_categories_type_float_or_datetime) and returns: unknown, False, False