class_docstr: Shared methods across categorical transformers.
  
  - BaseEstimator brings methods get_params() and set_params().
  - TransformerMixin brings method fit_transform()
  - GetFeatureNamesOutMixin brings method get_feature_names_out().
class_docstr_tok: ["Shared","methods","across","categorical","transformers",".","-","BaseEstimator","brings","methods","get_params","(",")","and","set_params","(",")",".","-","TransformerMixin","brings","method","fit_transform","(",")","-","GetFeatureNamesOutMixin","brings","method","get_feature_names_out","(",")","."]
docstr: Finds categorical variables, or alternatively checks that the variables
  entered by the user are of type object (categorical).
  Checks absence of NA.
  
  Parameters
  ----------
  X: Pandas DataFrame
  
  Raises
  ------
  TypeError
      If any user provided variable is not categorical
  ValueError
      If there are no categorical variables in the df or the df is empty
      If the variable(s) contain null values
docstr_tok: ["Finds","categorical","variables",",","or","alternatively","checks","that","the","variables","entered","by","the","user","are","of","type","object","(","categorical",")",".","Checks","absence","of","NA",".","Parameters","--","--","--","--","--","X",":","Pandas","DataFrame","Raises","--","--","--","TypeError","If","any","user","provided","variable","is","not","categorical","ValueError","If","there","are","no","categorical","variables","in","the","df","or","the","df","is","empty","If","the","variable","(","s",")","contain","null","values"]
code: def _check_or_select_variables(self, X: pd.DataFrame):
      """
      Finds categorical variables, or alternatively checks that the variables
      entered by the user are of type object (categorical).
      Checks absence of NA.
  
      Parameters
      ----------
      X: Pandas DataFrame
  
      Raises
      ------
      TypeError
          If any user provided variable is not categorical
      ValueError
          If there are no categorical variables in the df or the df is empty
          If the variable(s) contain null values
      """
      if self.ignore_format is False:
          # find categorical variables or check variables entered by user are object
          self.variables_: List[
              Union[str, int]
          ] = _find_or_check_categorical_variables(X, self.variables)
      else:
          # select all variables or check variables entered by the user
          self.variables_ = _find_all_variables(X, self.variables)
  
imports: import warnings
  from typing import List, Union
  import pandas
  from sklearn.base import BaseEstimator, TransformerMixin
  from sklearn.utils.validation import check_is_fitted
  from feature_engine._base_transformers.mixins import GetFeatureNamesOutMixin
  from feature_engine._docstrings.init_parameters import _ignore_format_docstring, _variables_categorical_docstring
  from feature_engine._docstrings.substitute import Substitution
  from feature_engine._variable_handling.init_parameter_checks import _check_init_parameter_variables
  from feature_engine._variable_handling.variable_type_selection import _find_all_variables, _find_or_check_categorical_variables
  from feature_engine.dataframe_checks import _check_contains_na, _check_X_matches_training_df, check_X
  from feature_engine.tags import _return_tags
label_desc: Use image node_id 2 for calling the CategoricalMethodsMixin obj's underlying member method code with example usage: obj._check_or_select_variables(X) without return types