class_docstr: Compute one or more top-N metrics over recommendation lists.
  
  This method groups the recommendations by the specified columns,
  and computes the metric over each group.  The default set of grouping
  columns is all columns *except* the following:
  
  * ``item``
  * ``rank``
  * ``score``
  * ``rating``
  
  The truth frame, ``truth``, is expected to match over (a subset of) the
  grouping columns, and contain at least an ``item`` column.  If it also
  contains a ``rating`` column, that is used as the users' rating for
  metrics that require it; otherwise, a rating value of 1 is assumed.
  
  Args:
      group_cols(list):
          The columns to group by, or ``None`` to use the default.
code: def _number_truth(self, truth, truth_key):
      _log.info("numbering truth lists")
      truth_df = truth[truth_key].drop_duplicates()
      truth_df["LKTruthID"] = np.arange(len(truth_df))
      truth = pd.merge(truth_df, truth, on=truth_key).drop(
          columns=truth_key
      )
  
      truth.set_index(["LKTruthID", "item"], inplace=True)
      if not truth.index.is_unique:
          _log.warn(
              "truth index not unique: may have duplicate items\n%s",
              truth,
          )
  
      return truth_df, truth
  
file_path: lkpy/lenskit/topn.py
imports: import logging
  import functools
  import numpy
  import pandas
  from .metrics.topn import *
  from .util import Stopwatch
label_desc: Use image node_id 4 for calling the RecListAnalysis obj's underlying member method code with example usage: obj._number_truth(truth, truth_key) and returns: truth_df,  truth