code: def test_random_split(df_engine, ray_cluster_2cpu):
      nrows = 100
      npartitions = 10
  
      df = pd.DataFrame(
          np.random.randint(0, 100, size=(nrows, 3)),
          columns=["A", "B", "C"],
      )
      if isinstance(df_engine, DaskEngine):
          df = df_engine.df_lib.from_pandas(df, npartitions=npartitions)
  
      probs = (0.7, 0.1, 0.2)
      split_params = {
          "type": "random",
          "probabilities": probs,
      }
      splitter = get_splitter(**split_params)
  
      backend = Mock()
      backend.df_engine = df_engine
      splits = splitter.split(df, backend, random_seed=42)
  
      assert len(splits) == 3
      for split, p in zip(splits, probs):
          if isinstance(df_engine, DaskEngine):
              # Dask splitting is not exact, so apply soft constraint here
              assert np.isclose(len(split), int(nrows * p), atol=5)
          else:
              assert len(split) == int(nrows * p)
  
      # Test determinism
      def compute(dfs):
          return [
              df.compute()
              if isinstance(backend.df_engine, DaskEngine)
              else df
              for df in dfs
          ]
  
      splits = compute(splits)
      splits2 = compute(splitter.split(df, backend, random_seed=7))
      for s1, s2 in zip(splits, splits2):
          assert not s1.equals(s2)
  
      splits3 = compute(splitter.split(df, backend, random_seed=42))
      for s1, s3 in zip(splits, splits3):
          assert s1.equals(s3)
  
file_path: ludwig/tests/ludwig/data/test_split.py
imports: from datetime import datetime, timedelta
  from itertools import combinations
  from random import randrange
  from unittest.mock import Mock
  import numpy
  import pandas
  import pytest
  from ludwig.data.dataframe.pandas import PandasEngine
  from ludwig.data.split import get_splitter
label_desc: Use image node_id 2 for calling a global function with example usage: test_random_split(df_engine, ray_cluster_2cpu) and returns: unknown