code: def test_equal_split_balanced_grid(ray_start_regular_shared):
      # Tests balanced equal splitting over a grid of configurations.
      # Grid: num_blocks x num_splits x num_rows_block_1 x ... x num_rows_block_n
      seed = int(time.time())
      print(
          f"Seeding RNG for test_equal_split_balanced_grid with: {seed}"
      )
      random.seed(seed)
      max_num_splits = 20
      num_splits_samples = 5
      max_num_blocks = 50
      max_num_rows_per_block = 100
      num_blocks_samples = 5
      block_sizes_samples = 5
      for num_splits in np.random.randint(
          2, max_num_splits + 1, size=num_splits_samples
      ):
          for num_blocks in np.random.randint(
              1, max_num_blocks + 1, size=num_blocks_samples
          ):
              block_sizes_list = [
                  np.random.randint(
                      1, max_num_rows_per_block + 1, size=num_blocks
                  )
                  for _ in range(block_sizes_samples)
              ]
              for block_sizes in block_sizes_list:
                  if sum(block_sizes) < num_splits:
                      min_ = math.ceil(num_splits / num_blocks)
                      block_sizes = np.random.randint(
                          min_,
                          max_num_rows_per_block + 1,
                          size=num_blocks,
                      )
                  _test_equal_split_balanced(block_sizes, num_splits)
  
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 4 for calling a global function with example usage: test_equal_split_balanced_grid(ray_start_regular_shared) without return types