code: def test_rect_pure_split():
      pure_square = [0.0, 0.0, 1.0, 1.0]
      # division in two equal pieces from the perfect square
      h_2split = [(0.0, 0.0, 0.5, 1.0), (0.5, 0.0, 0.5, 1.0)]
      conf_h = dict(proportion=[1, 1], gap=0.0, horizontal=True)
      eq(_split_rect(*pure_square, **conf_h), h_2split)
  
      v_2split = [(0.0, 0.0, 1.0, 0.5), (0.0, 0.5, 1.0, 0.5)]
      conf_v = dict(proportion=[1, 1], gap=0.0, horizontal=False)
      eq(_split_rect(*pure_square, **conf_v), v_2split)
  
      # division in two non-equal pieces from the perfect square
      h_2split = [(0.0, 0.0, 1 / 3, 1.0), (1 / 3, 0.0, 2 / 3, 1.0)]
      conf_h = dict(proportion=[1, 2], gap=0.0, horizontal=True)
      eq(_split_rect(*pure_square, **conf_h), h_2split)
  
      v_2split = [(0.0, 0.0, 1.0, 1 / 3), (0.0, 1 / 3, 1.0, 2 / 3)]
      conf_v = dict(proportion=[1, 2], gap=0.0, horizontal=False)
      eq(_split_rect(*pure_square, **conf_v), v_2split)
  
      # division in three equal pieces from the perfect square
      h_2split = [
          (0.0, 0.0, 1 / 3, 1.0),
          (1 / 3, 0.0, 1 / 3, 1.0),
          (2 / 3, 0.0, 1 / 3, 1.0),
      ]
      conf_h = dict(proportion=[1, 1, 1], gap=0.0, horizontal=True)
      eq(_split_rect(*pure_square, **conf_h), h_2split)
  
      v_2split = [
          (0.0, 0.0, 1.0, 1 / 3),
          (0.0, 1 / 3, 1.0, 1 / 3),
          (0.0, 2 / 3, 1.0, 1 / 3),
      ]
      conf_v = dict(proportion=[1, 1, 1], gap=0.0, horizontal=False)
      eq(_split_rect(*pure_square, **conf_v), v_2split)
  
      # division in three non-equal pieces from the perfect square
      h_2split = [
          (0.0, 0.0, 1 / 4, 1.0),
          (1 / 4, 0.0, 1 / 2, 1.0),
          (3 / 4, 0.0, 1 / 4, 1.0),
      ]
      conf_h = dict(proportion=[1, 2, 1], gap=0.0, horizontal=True)
      eq(_split_rect(*pure_square, **conf_h), h_2split)
  
      v_2split = [
          (0.0, 0.0, 1.0, 1 / 4),
          (0.0, 1 / 4, 1.0, 1 / 2),
          (0.0, 3 / 4, 1.0, 1 / 4),
      ]
      conf_v = dict(proportion=[1, 2, 1], gap=0.0, horizontal=False)
      eq(_split_rect(*pure_square, **conf_v), v_2split)
  
      # splitting on a void rectangle should give multiple void
      null_square = [0.0, 0.0, 0.0, 0.0]
      conf = dict(proportion=[1, 1], gap=0.0, horizontal=True)
      eq(_split_rect(*null_square, **conf), [null_square, null_square])
      conf = dict(proportion=[1, 2], gap=1.0, horizontal=True)
      eq(_split_rect(*null_square, **conf), [null_square, null_square])
  
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 12 for calling a global function with example usage: test_rect_pure_split() without return types