code: def spark_chrono_split(
      data,
      ratio=0.75,
      min_rating=1,
      filter_by="user",
      col_user=DEFAULT_USER_COL,
      col_item=DEFAULT_ITEM_COL,
      col_timestamp=DEFAULT_TIMESTAMP_COL,
      no_partition=False,
  ):
      """Spark chronological splitter.
  
      This function splits data in a chronological manner. That is, for each user / item, the
      split function takes proportions of ratings which is specified by the split ratio(s).
      The split is stratified.
  
      Args:
          data (pyspark.sql.DataFrame): Spark DataFrame to be split.
          ratio (float or list): Ratio for splitting data. If it is a single float number
              it splits data into two sets and the ratio argument indicates the ratio of
              training data set; if it is a list of float numbers, the splitter splits
              data into several portions corresponding to the split ratios. If a list is
              provided and the ratios are not summed to 1, they will be normalized.
          min_rating (int): minimum number of ratings for user or item.
          filter_by (str): either "user" or "item", depending on which of the two is to filter
              with min_rating.
          col_user (str): column name of user IDs.
          col_item (str): column name of item IDs.
          col_timestamp (str): column name of timestamps.
          no_partition (bool): set to enable more accurate and less efficient splitting.
  
      Returns:
          list: Splits of the input data as pyspark.sql.DataFrame.
      """
  
      return _do_stratification_spark(
          data=data,
          ratio=ratio,
          min_rating=min_rating,
          filter_by=filter_by,
          is_random=False,
          col_user=col_user,
          col_item=col_item,
          col_timestamp=col_timestamp,
      )
  
file_path: recommenders/recommenders/datasets/spark_splitters.py
imports: import numpy
  from recommenders.utils.constants import DEFAULT_ITEM_COL, DEFAULT_USER_COL, DEFAULT_TIMESTAMP_COL
  from recommenders.datasets.split_utils import process_split_ratio, min_rating_filter_spark
label_desc: Use image node_id 3 for calling a global function with example usage: spark_chrono_split(data, ratio, min_rating, filter_by, col_user, col_item, col_timestamp, no_partition) and returns: _do_stratification_spark