code: def test_uu_implicit_batch_accuracy():
      from lenskit import batch, topn
      import lenskit.crossfold as xf
  
      ratings = lktu.ml100k.ratings
  
      algo = knn.UserUser(30, center=False, aggregate="sum")
  
      folds = list(xf.partition_users(ratings, 5, xf.SampleFrac(0.2)))
      all_test = pd.concat(f.test for f in folds)
  
      rec_lists = []
      for train, test in folds:
          _log.info("running training")
          rec_algo = Recommender.adapt(algo)
          rec_algo.fit(train.loc[:, ["user", "item"]])
          _log.info("testing %d users", test.user.nunique())
          recs = batch.recommend(
              rec_algo, test.user.unique(), 100, n_jobs=2
          )
          rec_lists.append(recs)
      recs = pd.concat(rec_lists)
  
      rla = topn.RecListAnalysis()
      rla.add_metric(topn.ndcg)
      results = rla.compute(recs, all_test)
      user_dcg = results.ndcg
  
      dcg = user_dcg.mean()
      assert dcg >= 0.03
  
imports: from lenskit.algorithms import Recommender
  import lenskit.algorithms.user_knn
  from lenskit.util import clone
  from pathlib import Path
  import logging
  import pickle
  import pandas
  import numpy
  from scipy.sparse import linalg
  from pytest import approx, mark
  import lenskit.util.test
label_desc: Use image node_id 18 for calling a global function with example usage: test_uu_implicit_batch_accuracy() without return types