code: def recall(recs, truth, k=None):
      """
      Compute recommendation recall.  This is computed as:
  
      .. math::
          \\frac{|L \\cap I_u^{\\mathrm{test}}|}{\\operatorname{max}\\{|I_u^{\\mathrm{test}}|, k\\}}
  
      This metric has a bulk implementation.
      """
      nrel = len(truth)
      if nrel == 0:
          return None
  
      if k is not None:
          nrel = min(nrel, k)
          recs = recs.iloc[:k]
  
      ngood = recs["item"].isin(truth.index).sum()
      return ngood / nrel
  
file_path: lkpy/lenskit/metrics/topn.py
imports: import logging
  import warnings
  import numpy
  import pandas
label_desc: Use image node_id 4 for calling a global function with example usage: recall(recs, truth, k) and returns: unknown, None