code: def test_train_isolate():
      algo = Bias()
      algo = Recommender.adapt(algo)
  
      saved = train_isolated(algo, ml_test.ratings)
      try:
          trained = saved.get()
          assert isinstance(trained, TopN)
          recs = trained.recommend(10, 10)
          assert len(recs) == 10
          del recs, trained
      finally:
          saved.close()
  
imports: from lenskit.batch import train_isolated
  from lenskit.util.test import ml_test
  from lenskit.algorithms import Recommender
  from lenskit.algorithms.basic import TopN
  from lenskit.algorithms.bias import Bias
label_desc: Use image node_id 1 for calling a global function with example usage: test_train_isolate() without return types