code: def _is_categorical_and_is_datetime(column: pd.Series) -> bool:
      # check for datetime only if object cannot be cast as numeric because
      # if it could pd.to_datetime would convert it to datetime regardless
      if is_object(column):
          is_dt = not _is_convertible_to_num(
              column
          ) and _is_convertible_to_dt(column)
  
      # check for datetime only if the type of the categories is not numeric
      # because pd.to_datetime throws an error when it is an integer
      elif is_categorical(column):
          is_dt = not _is_categories_num(
              column
          ) and _is_convertible_to_dt(column)
  
      return is_dt
  
file_path: feature_engine/feature_engine/_variable_handling/variable_type_checks.py
imports: import pandas
  from pandas.core.dtypes.common import is_categorical_dtype
  from pandas.core.dtypes.common import is_datetime64_any_dtype
  from pandas.core.dtypes.common import is_numeric_dtype
  from pandas.core.dtypes.common import is_object_dtype
label_desc: Use image node_id 5 for calling a global function with example usage: _is_categorical_and_is_datetime(column) and returns: is_dt