code: def _check_contains_inf(
      X: pd.DataFrame, variables: List[Union[str, int]]
  ) -> None:
      """
      Checks if DataFrame contains inf values in the selected columns.
  
      Parameters
      ----------
      X : Pandas DataFrame
      variables : List
          The selected group of variables in which null values will be examined.
  
      Raises
      ------
      ValueError
          If the variable(s) contain np.inf values
      """
  
      if np.isinf(X[variables]).any().any():
          raise ValueError(
              "Some of the variables to transform contain inf values. Check and "
              "remove those before using this transformer."
          )
  
file_path: feature_engine/feature_engine/dataframe_checks.py
imports: from typing import List, Tuple, Union
  import numpy
  import pandas
  from scipy.sparse import issparse
  from sklearn.utils.validation import _check_y, check_consistent_length
label_desc: Use image node_id 6 for calling a global function with example usage: _check_contains_inf(X, variables) without return types