code: def test_rect_deformed_split():
      non_pure_square = [1.0, -1.0, 1.0, 0.5]
      # division in two equal pieces from the perfect square
      h_2split = [(1.0, -1.0, 0.5, 0.5), (1.5, -1.0, 0.5, 0.5)]
      conf_h = dict(proportion=[1, 1], gap=0.0, horizontal=True)
      eq(_split_rect(*non_pure_square, **conf_h), h_2split)
  
      v_2split = [(1.0, -1.0, 1.0, 0.25), (1.0, -0.75, 1.0, 0.25)]
      conf_v = dict(proportion=[1, 1], gap=0.0, horizontal=False)
      eq(_split_rect(*non_pure_square, **conf_v), v_2split)
  
      # division in two non-equal pieces from the perfect square
      h_2split = [
          (1.0, -1.0, 1 / 3, 0.5),
          (1 + 1 / 3, -1.0, 2 / 3, 0.5),
      ]
      conf_h = dict(proportion=[1, 2], gap=0.0, horizontal=True)
      eq(_split_rect(*non_pure_square, **conf_h), h_2split)
  
      v_2split = [(1.0, -1.0, 1.0, 1 / 6), (1.0, 1 / 6 - 1, 1.0, 2 / 6)]
      conf_v = dict(proportion=[1, 2], gap=0.0, horizontal=False)
      eq(_split_rect(*non_pure_square, **conf_v), v_2split)
  
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 13 for calling a global function with example usage: test_rect_deformed_split() without return types