code: def _split_dataset_pandas(
      dataset,
      split_type: Literal["n_instances", "fraction", "condition"],
      split: int | float | pd.Series | str,
  ):
      if split_type in ["n_instances", "fraction"]:
          if split_type == "fraction":
              n = dataset.shape[0]
              split = floor(split * n)
          reference = dataset.iloc[:split]
          df = dataset.iloc[split:]
      else:
          reference = dataset[split]
          df = dataset[~split]
  
      if reference.empty:
          raise ValueError(
              "Reference is empty. Please adjust the `split` argument"
          )
      if df.empty:
          raise ValueError(
              "Returned dataframe is empty. Please adjust the `split` argument"
          )
  
      return reference, df
  
imports: from __future__ import annotations
  from math import floor
  import pandas
  from typing_extensions import Literal
label_desc: Use image node_id 1 for calling a global function with example usage: _split_dataset_pandas(dataset, split_type, split) and returns: reference,  df