code: def test_proportion_normalization():
      # extremes should give the whole set, as well
      # as if 0 is inserted
      eq(_normalize_split(0.0), [0.0, 0.0, 1.0])
      eq(_normalize_split(1.0), [0.0, 1.0, 1.0])
      eq(_normalize_split(2.0), [0.0, 1.0, 1.0])
      # negative values should raise ValueError
      assert_raises(ValueError, _normalize_split, -1)
      assert_raises(ValueError, _normalize_split, [1.0, -1])
      assert_raises(ValueError, _normalize_split, [1.0, -1, 0.0])
      # if everything is zero it will complain
      assert_raises(ValueError, _normalize_split, [0.0])
      assert_raises(ValueError, _normalize_split, [0.0, 0.0])
      # one-element array should return the whole interval
      eq(_normalize_split([0.5]), [0.0, 1.0])
      eq(_normalize_split([1.0]), [0.0, 1.0])
      eq(_normalize_split([2.0]), [0.0, 1.0])
      # simple division should give two pieces
      for x in [0.3, 0.5, 0.9]:
          eq(_normalize_split(x), [0.0, x, 1.0])
      # multiple division should split as the sum of the components
      for x, y in [(0.25, 0.5), (0.1, 0.8), (10.0, 30.0)]:
          eq(_normalize_split([x, y]), [0.0, x / (x + y), 1.0])
      for x, y, z in [
          (1.0, 1.0, 1.0),
          (0.1, 0.5, 0.7),
          (10.0, 30.0, 40),
      ]:
          eq(
              _normalize_split([x, y, z]),
              [0.0, x / (x + y + z), (x + y) / (x + y + z), 1.0],
          )
  
imports: from statsmodels.compat.python import lrange
  from io import BytesIO
  from itertools import product
  import numpy
  from numpy.testing import assert_, assert_raises
  import pandas
  import pytest
  from statsmodels.api import datasets
  from statsmodels.graphics.mosaicplot import _hierarchical_split, _key_splitting, _normalize_split, _reduce_dict, _split_rect, mosaic
label_desc: Use image node_id 10 for calling a global function with example usage: test_proportion_normalization() without return types