code: def test_recommend_no_cands(mlb):
      res = batch.recommend(mlb.algo, [5, 10], 10)
  
      assert len(res) == 20
      assert set(res.user) == set([5, 10])
      assert all(res.groupby("user").item.count() == 10)
      assert all(res.groupby("user")["rank"].max() == 10)
      assert all(np.diff(res[res.user == 5].score) <= 0)
      assert all(np.diff(res[res.user == 5]["rank"]) == 1)
      assert all(np.diff(res[res.user == 10].score) <= 0)
      assert all(np.diff(res[res.user == 10]["rank"]) == 1)
  
      idx_rates = mlb.ratings.set_index(["user", "item"])
      merged = res.join(idx_rates, on=["user", "item"], how="inner")
      assert len(merged) == 0
  
imports: import pytest
  from collections import namedtuple
  import logging
  import pandas
  import numpy
  import lenskit.util.test
  from lenskit.algorithms.basic import TopN, Popular
  from lenskit.algorithms.bias import Bias
  from lenskit import batch, topn
  import lenskit.crossfold
label_desc: Use image node_id 6 for calling a global function with example usage: test_recommend_no_cands(mlb) without return types