code: def spark_random_split(data, ratio=0.75, seed=42):
      """Spark random splitter.
  
      Randomly split the data into several splits.
  
      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 halves 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.
          seed (int): Seed.
  
      Returns:
          list: Splits of the input data as pyspark.sql.DataFrame.
      """
      multi_split, ratio = process_split_ratio(ratio)
  
      if multi_split:
          return data.randomSplit(ratio, seed=seed)
      else:
          return data.randomSplit([ratio, 1 - ratio], seed=seed)
  
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 1 for calling a global function with example usage: spark_random_split(data, ratio, seed) and returns: data, data