code: def stratified_split_dataset(
      dataset: pd.DataFrame,
      target_column: str,
      test_size: float,
      random_state: Optional[int] = None,
  ) -> Tuple[pd.DataFrame, pd.DataFrame]:
      """
      Splits data into a training and testing datasets such that
      they maintain the same class ratio of the original dataset.
  
      Parameters
      ----------
      dataset : pandas.DataFrame
          A Pandas' DataFrame with the target column.
          The model will be trained to predict the target column
          from the features.
  
      target_column : str
          The name of the target column of `dataset`.
  
      test_size : float
          Represent the proportion of the dataset to include in the test split.
          should be between 0.0 and 1.0.
  
      random_state : int or None, optional (default=None)
          If int, random_state is the seed used by the random number generator;
          If None, the random number generator is the RandomState instance used
          by `np.random`.
  
      Returns
      ----------
      train_set : pandas.DataFrame
          The train dataset sampled from the full dataset.
  
      test_set : pandas.DataFrame
          The test dataset sampled from the full dataset.
      """
      train_placeholder = np.zeros(len(dataset))
      target = dataset[target_column]
  
      splitter = StratifiedShuffleSplit(
          n_splits=1, test_size=test_size, random_state=random_state
      )
  
      train_indices, test_indices = next(
          splitter.split(train_placeholder, target)
      )
      train_set = dataset.iloc[train_indices]
      test_set = dataset.iloc[test_indices]
  
      return train_set, test_set
  
file_path: fklearn/src/fklearn/preprocessing/splitting.py
imports: from typing import Optional, Tuple
  import numpy
  from numpy.random import RandomState
  import pandas
  from sklearn.model_selection import StratifiedShuffleSplit
  from toolz import curry
  from fklearn.types import DateType
label_desc: Use image node_id 3 for calling a global function with example usage: stratified_split_dataset(dataset, target_column, test_size, random_state) and returns: train_set,  test_set