code: def get_clean_Xy(df):
      """Return (X, y) cleaned of NaN values"""
      X = get_X(df)
      y = get_y(df).values
      isnan = np.isnan(y)
      X = X[~isnan]
      y = y[~isnan]
      return X, y
  
file_path: backtesting.py/doc/examples/Trading with Machine Learning.py
imports: from backtesting.test import EURUSD, SMA
  import numpy
  import pandas
  from sklearn.neighbors import KNeighborsClassifier
  from sklearn.model_selection import train_test_split
  from backtesting import Backtest, Strategy
label_desc: Use image node_id 4 for calling a global function with example usage: get_clean_Xy(df) and returns: X,  y