code: def test_leave_k_out_gets_correct_train_only_shape():
      """Test that the correct number of users appear *only* in the train set."""
  
      mat = _get_matrix()
      train, test = leave_k_out_split(mat, K=1, train_only_size=0.8)
      train_only = ~np.isin(
          np.unique(train.tocoo().row), test.tocoo().row
      )
  
      assert train_only.sum() == int(train.shape[0] * 0.8)
  
file_path: implicit/tests/evaluation_test.py
imports: import numpy
  import pytest
  from scipy.sparse import csr_matrix, random
  import implicit
  from implicit.evaluation import leave_k_out_split, precision_at_k, train_test_split
  from implicit.datasets.movielens import get_movielens
label_desc: Use image node_id 7 for calling a global function with example usage: test_leave_k_out_gets_correct_train_only_shape() without return types