code: def ensure_numpy_array(
      X: Union[np.ndarray, pd.DataFrame]
  ) -> np.ndarray:
      if isinstance(X, pd.DataFrame):
          return X.values
      else:
          return X
  
imports: from operator import gt, le
  from typing import Any, List, Optional, Union
  import numpy
  import pandas
  from .errors import NoSplittableVariableException
  from .splitcondition import SplitCondition
label_desc: Use image node_id 2 for calling a global function with example usage: ensure_numpy_array(X) and returns: X, X