code: def test_normalize_ratios():
      """Test normalize_ratios."""
      for ratios, exp_output in (
          (0.5, (0.5, 0.5)),
          ((0.3, 0.2, 0.4), (0.3, 0.2, 0.4, 0.1)),
          ((0.3, 0.3, 0.4), (0.3, 0.3, 0.4)),
      ):
          output = normalize_ratios(ratios=ratios)
          # check type
          assert isinstance(output, tuple)
          assert all(isinstance(ratio, float) for ratio in output)
          # check values
          assert len(output) >= 2
          assert all(0 <= ratio <= 1 for ratio in output)
          output_np = numpy.asarray(output)
          numpy.testing.assert_almost_equal(
              output_np.sum(), numpy.ones(1)
          )
          # compare against expected
          numpy.testing.assert_almost_equal(
              output_np, numpy.asarray(exp_output)
          )
  
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 2 for calling a global function with example usage: test_normalize_ratios() without return types