code: def test_list_splits():
      with pytest.raises(AssertionError):
          _split_list(list(range(5)), 0)
  
      with pytest.raises(AssertionError):
          _split_list(list(range(5)), -1)
  
      assert _split_list(list(range(5)), 7) == [
          [0],
          [1],
          [2],
          [3],
          [4],
          [],
          [],
      ]
      assert _split_list(list(range(5)), 2) == [[0, 1, 2], [3, 4]]
      assert _split_list(list(range(6)), 2) == [[0, 1, 2], [3, 4, 5]]
      assert _split_list(list(range(5)), 1) == [[0, 1, 2, 3, 4]]
      assert _split_list(["foo", 1, [0], None], 2) == [
          ["foo", 1],
          [[0], None],
      ]
      assert _split_list(["foo", 1, [0], None], 3) == [
          ["foo", 1],
          [[0]],
          [None],
      ]
  
file_path: ray/python/ray/data/tests/test_util.py
imports: import time
  from typing import Any, Dict, Optional
  from unittest.mock import patch
  import numpy
  import pytest
  import ray
  from ray.data._internal.logical.operators.read_operator import Read
  from ray.data._internal.memory_tracing import leak_report, trace_allocation, trace_deallocation
  from ray.data._internal.util import _check_pyarrow_version, _split_list
  from ray.data.datasource.parquet_datasource import ParquetDatasource
  from ray.data.tests.conftest import *
label_desc: Use image node_id 5 for calling a global function with example usage: test_list_splits() without return types