code: def merge_rating_true_pred(
      rating_true,
      rating_pred,
      col_user=DEFAULT_USER_COL,
      col_item=DEFAULT_ITEM_COL,
      col_rating=DEFAULT_RATING_COL,
      col_prediction=DEFAULT_PREDICTION_COL,
  ):
      """Join truth and prediction data frames on userID and itemID and return the true
      and predicted rated with the correct index.
  
      Args:
          rating_true (pandas.DataFrame): True data
          rating_pred (pandas.DataFrame): Predicted data
          col_user (str): column name for user
          col_item (str): column name for item
          col_rating (str): column name for rating
          col_prediction (str): column name for prediction
  
      Returns:
          numpy.ndarray: Array with the true ratings
          numpy.ndarray: Array with the predicted ratings
  
      """
  
      # pd.merge will apply suffixes to columns which have the same name across both dataframes
      suffixes = ["_true", "_pred"]
      rating_true_pred = pd.merge(
          rating_true,
          rating_pred,
          on=[col_user, col_item],
          suffixes=suffixes,
      )
      if col_rating in rating_pred.columns:
          col_rating = col_rating + suffixes[0]
      if col_prediction in rating_true.columns:
          col_prediction = col_prediction + suffixes[1]
      return (
          rating_true_pred[col_rating],
          rating_true_pred[col_prediction],
      )
  
imports: import numpy
  import pandas
  from functools import wraps
  from sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score, explained_variance_score, roc_auc_score, log_loss
  from recommenders.utils.constants import DEFAULT_USER_COL, DEFAULT_ITEM_COL, DEFAULT_RATING_COL, DEFAULT_PREDICTION_COL, DEFAULT_RELEVANCE_COL, DEFAULT_SIMILARITY_COL, DEFAULT_ITEM_FEATURES_COL, DEFAULT_ITEM_SIM_MEASURE, DEFAULT_K, DEFAULT_THRESHOLD
  from recommenders.datasets.pandas_df_utils import has_columns, has_same_base_dtype, lru_cache_df
label_desc: Use image node_id 2 for calling a global function with example usage: merge_rating_true_pred(rating_true, rating_pred, col_user, col_item, col_rating, col_prediction) and returns: rating_true_pred,  rating_true_pred