code: def check_valid_split(train, test, n_samples=None):
      # Use python sets to get more informative assertion failure messages
      train = train.execute().to_numpy()
      test = test.execute().to_numpy()
      train, test = set(train), set(test)
  
      # Train and test split should not overlap
      assert train.intersection(test) == set()
  
      if n_samples is not None:
          # Check that the union of train an test split cover all the indices
          assert train.union(test) == set(range(n_samples))
  
imports: import itertools
  import numpy
  import pandas
  import pytest
  from ....None import dataframe
  from ....None import tensor
  from ....dataframe.core import DATAFRAME_TYPE
  from ....lib.sparse import SparseNDArray
  from ...utils.validation import _num_samples
  from ..None import train_test_split, KFold
label_desc: Use image node_id 10 for calling a global function with example usage: check_valid_split(train, test, n_samples) without return types