code: def test_stratified_split_dataset(sample, random_state, test_size):
      expected_data, target_column_name, num_classes = sample
  
      train_data, test_data = stratified_split_dataset(
          expected_data,
          target_column_name,
          test_size=test_size,
          random_state=random_state,
      )
  
      total_samples = len(expected_data)
      expected_test_size = int(total_samples * test_size)
      expected_train_size = total_samples - expected_test_size
  
      expected_test_samples_per_class = expected_test_size / num_classes
      expected_train_samples_per_class = (
          expected_train_size / num_classes
      )
  
      data = pd.concat([train_data, test_data])
  
      assert (
          abs(len(train_data) - expected_train_size)
          <= MAX_STRATIFIED_SPLIT_SIZE_DIFFERENCE
      )
      assert (
          abs(len(test_data) - expected_test_size)
          <= MAX_STRATIFIED_SPLIT_SIZE_DIFFERENCE
      )
  
      assert_frame_equal(data, expected_data, check_like=True)
      assert_sample_size_per_class(
          train_data,
          target_column_name,
          expected_train_samples_per_class,
      )
      assert_sample_size_per_class(
          test_data, target_column_name, expected_test_samples_per_class
      )
  
file_path: fklearn/tests/preprocessing/test_splitting.py
imports: from collections import Counter
  import hypothesis.strategies
  import pandas
  from hypothesis import given
  from hypothesis.extra.pandas import columns, data_frames, range_indexes
  from pandas.testing import assert_frame_equal
  from fklearn.preprocessing.splitting import space_time_split_dataset, time_split_dataset, stratified_split_dataset
label_desc: Use image node_id 5 for calling a global function with example usage: test_stratified_split_dataset(sample, random_state, test_size) without return types