code: def test_split(ray_start_regular_shared):
      ds = ray.data.range(20, parallelism=10)
      assert ds.num_blocks() == 10
      assert ds.sum() == 190
      assert ds._block_num_rows() == [2] * 10
  
      datasets = ds.split(5)
      assert [2] * 5 == [
          dataset._plan.execute().initial_num_blocks()
          for dataset in datasets
      ]
      assert 190 == sum([dataset.sum("id") for dataset in datasets])
  
      datasets = ds.split(3)
      assert [4, 3, 3] == [
          dataset._plan.execute().initial_num_blocks()
          for dataset in datasets
      ]
      assert 190 == sum([dataset.sum("id") for dataset in datasets])
  
      datasets = ds.split(1)
      assert [10] == [
          dataset._plan.execute().initial_num_blocks()
          for dataset in datasets
      ]
      assert 190 == sum([dataset.sum("id") for dataset in datasets])
  
      datasets = ds.split(10)
      assert [1] * 10 == [
          dataset._plan.execute().initial_num_blocks()
          for dataset in datasets
      ]
      assert 190 == sum([dataset.sum("id") for dataset in datasets])
  
      datasets = ds.split(11)
      assert [1] * 10 + [0] == [
          dataset._plan.execute().initial_num_blocks()
          for dataset in datasets
      ]
      assert 190 == sum(
          [dataset.sum("id") or 0 for dataset in datasets]
      )
  
imports: import itertools
  import math
  import random
  import time
  from unittest.mock import patch
  import numpy
  import pandas
  import pytest
  import ray
  from ray.data._internal.block_list import BlockList
  from ray.data._internal.equalize import _equalize
  from ray.data._internal.execution.interfaces import RefBundle
  from ray.data._internal.logical.interfaces import LogicalPlan
  from ray.data._internal.logical.operators.input_data_operator import InputData
  from ray.data._internal.plan import ExecutionPlan
  from ray.data._internal.split import _drop_empty_block_split, _generate_global_split_results, _generate_per_block_split_indices, _generate_valid_indices, _split_at_indices, _split_single_block
  from ray.data._internal.stats import DatasetStats
  from ray.data.block import BlockAccessor, BlockMetadata
  from ray.data.dataset import Dataset
  from ray.data.tests.conftest import *
  from ray.data.tests.util import extract_values
  from ray.tests.conftest import *
label_desc: Use image node_id 10 for calling a global function with example usage: test_split(ray_start_regular_shared) without return types