code: def _validate_Xyt(X, y, target_col, do_clean=True):
      """Ensure y and target_col are exclusive.
  
      Make sure either y or target_col is passed.
      If target_col is passed, extract it from X.
      """
      if (
          (y is None and target_col is None)
          or (y is not None)
          and (target_col is not None)
      ):
          raise ValueError("Need to specify either y or target_col.")
      if do_clean:
          X = clean(X)
      elif not isinstance(X, pd.DataFrame):
          X = pd.DataFrame(X)
      if target_col is not None:
          y = X[target_col]
          X = X.drop(target_col, axis=1)
      elif not isinstance(y, (pd.Series, pd.DataFrame)):
          y = pd.Series(y)
      return X, y
  
imports: import pandas
  from scipy.sparse import issparse
  from .preprocessing import clean
label_desc: Use image node_id 2 for calling a global function with example usage: _validate_Xyt(X, y, target_col, do_clean) and returns: X,  y