code: def test_leave_k_split_is_reservable():
      """
      Test that the sum of the train and test set equals the input.
      """
  
      mat = _get_matrix()
      train, test = leave_k_out_split(mat, K=1)
  
      # check all matrices are positive, non-zero
      assert mat.sum() > 0
      assert test.sum() > 0
      assert train.sum() > 0
  
      # check sum of train + test = input
      assert ((train + test) - mat).nnz == 0
  
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 6 for calling a global function with example usage: test_leave_k_split_is_reservable() without return types