code: def _get_pairwise_items(
      df,
      col_user=DEFAULT_USER_COL,
      col_item=DEFAULT_ITEM_COL,
  ):
      """Get pairwise combinations of items per user (ignoring duplicate pairs [1,2] == [2,1])"""
      df_user_i1 = df[[col_user, col_item]]
      df_user_i1.columns = [col_user, "i1"]
  
      df_user_i2 = df[[col_user, col_item]]
      df_user_i2.columns = [col_user, "i2"]
  
      df_user_i1_i2 = pd.merge(
          df_user_i1, df_user_i2, how="inner", on=[col_user]
      )
  
      df_pairwise_items = df_user_i1_i2[
          (df_user_i1_i2["i1"] <= df_user_i1_i2["i2"])
      ][[col_user, "i1", "i2"]].reset_index(drop=True)
      return df_pairwise_items
  
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 19 for calling a global function with example usage: _get_pairwise_items(df, col_user, col_item) and returns: df_pairwise_items