code: def _find_or_check_numerical_variables(
      X: pd.DataFrame, variables: Variables = None
  ) -> List[Union[str, int]]:
      """
      Checks that variables provided by the user are of type numerical. If None, finds
      all the numerical variables in the DataFrame.
  
      Parameters
      ----------
      X : Pandas DataFrame.
      variables : variable or list of variables. Defaults to None.
  
      Raises
      ------
      ValueError
          If there are no numerical variables in the df or the df is empty.
      TypeError
          If any of the user provided variables are not numerical.
  
      Returns
      -------
      variables: List of numerical variables.
      """
  
      if variables is None:
          # find numerical variables in dataset
          variables = list(X.select_dtypes(include="number").columns)
          if len(variables) == 0:
              raise ValueError(
                  "No numerical variables found in this dataframe. Please check "
                  "variable format with pandas dtypes."
              )
  
      elif isinstance(variables, (str, int)):
          if is_numeric(X[variables]):
              variables = [variables]
          else:
              raise TypeError("The variable entered is not numeric.")
  
      else:
          if len(variables) == 0:
              raise ValueError("The list of variables is empty.")
  
          # check that user entered variables are of type numerical
          else:
              if (
                  len(
                      X[variables]
                      .select_dtypes(exclude="number")
                      .columns
                  )
                  > 0
              ):
                  raise TypeError(
                      "Some of the variables are not numerical. Please cast them as "
                      "numerical before using this transformer."
                  )
  
      return variables
  
file_path: feature_engine/feature_engine/_variable_handling/variable_type_selection.py
imports: from typing import List, Tuple, Union
  import pandas
  from pandas.api.types import is_categorical_dtype
  from pandas.api.types import is_datetime64_any_dtype
  from pandas.api.types import is_numeric_dtype
  from pandas.api.types import is_object_dtype
  from feature_engine._variable_handling.variable_type_checks import _is_categorical_and_is_datetime, _is_categorical_and_is_not_datetime
label_desc: Use image node_id 1 for calling a global function with example usage: _find_or_check_numerical_variables(X, variables) and returns: variables