code: def _make_divisions_ensure_minimum_rows(
      divisions: List[int],
      n_examples: int,
      min_val_rows: int = MIN_DATASET_SPLIT_ROWS,
      min_test_rows: int = MIN_DATASET_SPLIT_ROWS,
  ) -> List[int]:
      """Revises divisions to ensure no dataset split has too few examples."""
      result = list(divisions)
      n = [
          dn - dm
          for dm, dn in zip((0,) + divisions, divisions + (n_examples,))
      ]  # Number of examples in each split.
      if 0 < n[2] < min_test_rows and n[0] > 0:
          # Test set is nonempty but too small, take examples from training set.
          shift = min(min_test_rows - n[2], n[0])
          result = [d - shift for d in result]
      if 0 < n[1] < min_val_rows and n[0] > 0:
          # Validation set is nonempty but too small, take examples from training set.
          result[0] -= min(min_val_rows - n[1], result[0])
      return result
  
imports: import logging
  from abc import ABC, abstractmethod
  from typing import List, Optional, Tuple, TYPE_CHECKING
  from zlib import crc32
  import numpy
  from sklearn.model_selection import train_test_split
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.backend.base import Backend
  from ludwig.constants import BINARY, CATEGORY, DATE, MIN_DATASET_SPLIT_ROWS, SPLIT
  from ludwig.error import ConfigValidationError
  from ludwig.schema.split import DateTimeSplitConfig, FixedSplitConfig, HashSplitConfig, RandomSplitConfig, StratifySplitConfig
  from ludwig.types import ModelConfigDict, PreprocessingConfigDict
  from ludwig.utils.data_utils import hash_dict, split_dataset_ttv
  from ludwig.utils.defaults import default_random_seed
  from ludwig.utils.registry import Registry
  from ludwig.utils.types import DataFrame
label_desc: Use image node_id 1 for calling a global function with example usage: _make_divisions_ensure_minimum_rows(divisions, n_examples, min_val_rows, min_test_rows) and returns: result