code: def test_get_absolute_split_sizes():
      """Test get_absolute_split_sizes."""
      for num_splits, n_total in zip(
          (2, 3, 4),
          (100, 200, 10412),
      ):
          # generate random ratios
          ratios = numpy.random.uniform(size=(num_splits,))
          ratios = ratios / ratios.sum()
          sizes = get_absolute_split_sizes(
              n_total=n_total, ratios=ratios
          )
          # check size
          assert len(sizes) == len(ratios)
  
          # check value range
          assert all(0 <= size <= n_total for size in sizes)
  
          # check total split
          assert sum(sizes) == n_total
  
          # check consistency with ratios
          rel_size = numpy.asarray(sizes) / n_total
          # the number of decimal digits equivalent to 1 / n_total
          decimal = numpy.floor(numpy.log10(n_total))
          numpy.testing.assert_almost_equal(
              rel_size, ratios, decimal=decimal
          )
  
imports: import numpy
  import pytest
  import torch
  from pykeen.triples.splitting import CleanupSplitter, CoverageSplitter, DeterministicCleaner, RandomizedCleaner, _get_cover_deterministic, get_absolute_split_sizes, normalize_ratios
  from pykeen.triples.utils import get_entities, get_relations
  from pykeen.utils import triple_tensor_to_set
  from tests.cases import CleanerTestCase, SplitterTestCase
label_desc: Use image node_id 1 for calling a global function with example usage: test_get_absolute_split_sizes() without return types