code: def prepare_training_ncf(df_train, df_test):
      train = df_train.sort_values(["userID"], axis=0, ascending=[True])
      test = df_test.sort_values(["userID"], axis=0, ascending=[True])
      test = test[df_test["userID"].isin(train["userID"].unique())]
      test = test[test["itemID"].isin(train["itemID"].unique())]
      train.to_csv(TRAIN_FILE, index=False)
      test.to_csv(TEST_FILE, index=False)
      return NCFDataset(
          train_file=TRAIN_FILE,
          col_user=DEFAULT_USER_COL,
          col_item=DEFAULT_ITEM_COL,
          col_rating=DEFAULT_RATING_COL,
          seed=SEED,
      )
  
imports: import os
  import numpy
  import pandas
  from tempfile import TemporaryDirectory
  import surprise
  import cornac
  from recommenders.utils.timer import Timer
  from recommenders.utils.constants import COL_DICT, DEFAULT_K, DEFAULT_USER_COL, DEFAULT_ITEM_COL, DEFAULT_RATING_COL, DEFAULT_PREDICTION_COL, DEFAULT_TIMESTAMP_COL, SEED
  from recommenders.models.sar import SAR
  from recommenders.models.surprise.surprise_utils import predict, compute_ranking_predictions
  from recommenders.models.cornac.cornac_utils import predict_ranking
  from recommenders.evaluation.python_evaluation import map, ndcg_at_k, precision_at_k, recall_at_k
  from recommenders.evaluation.python_evaluation import rmse, mae, rsquared, exp_var
label_desc: Use image node_id 15 for calling a global function with example usage: prepare_training_ncf(df_train, df_test) and returns: NCFDataset