code: def split_arrivals(
      self, data: pd.DataFrame, grouped: bool
  ) -> (pd.DataFrame, pd.DataFrame):
      train_ratio = 0.8
  
      if grouped:
          group = "Country"
          train = pd.DataFrame(columns=data.columns)
          test = pd.DataFrame(columns=data.columns)
          for g in data[group].unique():
              subframe = data[data[group] == g]
              length = subframe.shape[0]
              train = pd.concat(
                  [train, subframe[: int(length * train_ratio)]],
                  ignore_index=True,
              )
              test = pd.concat(
                  [test, subframe[int(length * train_ratio) :]],
                  ignore_index=True,
              )
      else:
          train = data[: int(data.shape[0] * train_ratio)]
          test = data[int(data.shape[0] * train_ratio) :]
  
      return train, test
  
imports: import random
  from datetime import datetime
  from datetime import timedelta
  import unittest
  import numpy
  import pandas
  from typing import List
  from scipy import signal
  from sklearn.metrics import r2_score
  from lightwood.api.types import ProblemDefinition
  from tests.utils.timing import train_and_check_time_aim
  from sktime.forecasting.base import ForecastingHorizon
  from sktime.forecasting.statsforecast import StatsForecastAutoARIMA
  from dataprep_ml.splitters import stratify
  from lightwood.api.high_level import json_ai_from_problem, code_from_json_ai, predictor_from_code, predictor_from_problem, predictor_from_json_ai
  from lightwood.mixer.sktime import SkTime
label_desc: Use image node_id 2 for calling the TestTimeseries obj's underlying member method code with example usage: obj.split_arrivals(data, grouped) and returns: train,  test