code: def compare_metric(df_list, metric="prec", stage="test"):
      """Function to combine and prepare list of dataframes into tidy format.
  
      Args:
          df_list (list): List of dataframes
          metrics (str): name of metric to be extracted, optional
          stage (str): name of model fitting stage to be extracted, optional
  
      Returns:
          pandas.DataFrame: Metrics
      """
      colnames = [
          "model" + str(x) for x in list(range(1, len(df_list) + 1))
      ]
      models = [
          df[(df["stage"] == stage) & (df["metric"] == metric)]["value"]
          .reset_index(drop=True)
          .values
          for df in df_list
      ]
  
      output = (
          pd.DataFrame(zip(*models), columns=colnames)
          .stack()
          .reset_index()
      )
      output.columns = ["epoch", "data", "value"]
      return output
  
file_path: recommenders/recommenders/models/lightfm/lightfm_utils.py
imports: import pandas
  import numpy
  import seaborn
  from lightfm.evaluation import precision_at_k, recall_at_k
label_desc: Use image node_id 2 for calling a global function with example usage: compare_metric(df_list, metric, stage) and returns: output