code: def _split_divisions_with_min_rows(
      n_rows: int, probabilities: List[float]
  ) -> List[int]:
      """Generates splits for a dataset of n_rows into train, validation, and test sets according to split
      probabilities, also ensuring that at least min_val_rows or min_test_rows are present in each nonempty split.
  
      Returns division indices to split on.
      """
      d1 = int(np.ceil(probabilities[0] * n_rows))
      if probabilities[-1] > 0:
          n2 = int(probabilities[1] * n_rows)
          d2 = d1 + n2
      else:
          # If the last probability is 0, then use the entire remaining dataset for validation.
          d2 = n_rows
      return _make_divisions_ensure_minimum_rows((d1, d2), n_rows)
  
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 2 for calling a global function with example usage: _split_divisions_with_min_rows(n_rows, probabilities) and returns: _make_divisions_ensure_minimum_rows