code: def test_batch_predict_preshared():
      "Test batch prediction with isolated training and a pre-serialized algorithm."
      from lenskit.algorithms import bias
      import lenskit.crossfold as xf
  
      algo = bias.Bias()
      splits = xf.sample_users(
          lktu.ml_test.ratings, 1, 100, xf.SampleN(5)
      )
      train, test = next(splits)
  
      ares = lkb.train_isolated(algo, train)
      preds = lkb.predict(ares, test)
      assert len(preds) == len(test)
      assert not any(preds["prediction"].isna())
  
file_path: lkpy/tests/test_batch_predict.py
imports: import pytest
  import logging
  from collections import namedtuple
  import pandas
  import numpy
  import lenskit.util.test
  from lenskit.algorithms.bias import Bias
  import lenskit.batch
label_desc: Use image node_id 7 for calling a global function with example usage: test_batch_predict_preshared() without return types