code: def test_split_single_block(ray_start_regular_shared):
      block = pd.DataFrame({"id": [1, 2, 3]})
      metadata = _create_meta(3)
  
      results = ray.get(
          ray.remote(_split_single_block)
          .options(num_returns=2)
          .remote(234, block, metadata, [])
      )
      block_id, meta = results[0]
      blocks = results[1:]
      assert 234 == block_id
      assert len(blocks) == 1
      assert list(blocks[0]["id"]) == [1, 2, 3]
      assert meta[0].num_rows == 3
  
      results = ray.get(
          ray.remote(_split_single_block)
          .options(num_returns=3)
          .remote(234, block, metadata, [1])
      )
      block_id, meta = results[0]
      blocks = results[1:]
      assert 234 == block_id
      assert len(blocks) == 2
      assert list(blocks[0]["id"]) == [1]
      assert meta[0].num_rows == 1
      assert list(blocks[1]["id"]) == [2, 3]
      assert meta[1].num_rows == 2
  
      results = ray.get(
          ray.remote(_split_single_block)
          .options(num_returns=6)
          .remote(234, block, metadata, [0, 1, 1, 3])
      )
      block_id, meta = results[0]
      blocks = results[1:]
      assert 234 == block_id
      assert len(blocks) == 5
      assert list(blocks[0]["id"]) == []
      assert list(blocks[1]["id"]) == [1]
      assert list(blocks[2]["id"]) == []
      assert list(blocks[3]["id"]) == [2, 3]
      assert list(blocks[4]["id"]) == []
  
      block = pd.DataFrame({"id": []})
      metadata = _create_meta(0)
  
      results = ray.get(
          ray.remote(_split_single_block)
          .options(num_returns=3)
          .remote(234, block, metadata, [0])
      )
      block_id, meta = results[0]
      blocks = results[1:]
      assert 234 == block_id
      assert len(blocks) == 2
      assert list(blocks[0]["id"]) == []
      assert list(blocks[1]["id"]) == []
  
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 18 for calling a global function with example usage: test_split_single_block(ray_start_regular_shared) without return types