code: def squarify(sizes, x, y, dx, dy):
      """
      Calculate rectangle dimensions for list of values relative to a given
      width (dx) and height (dy), starting at given x-axis and y-axis values.
      List 'sizes' must be normalized, unless dx * dy == sum(sizes).
  
      :param sizes: Ordered (desc) list of values normalized with respect to
          overall height (dy) and width values (dx)
      :param x: Remaining area start point on treemap x-axis
      :param y: Remaining area start point on treemap y-axis
      :param dx: Remaining treemap width
      :param dy: Remaining treemap height
  
      :return: List of dictionaries of rectangle dimensions
      """
      sizes = list(map(float, sizes))
  
      if len(sizes) == 0:
          return []
  
      if len(sizes) == 1:
          return layout(sizes, x, y, dx, dy)
  
      # figure out where 'split' should be based on utilization of remaining area
      # determined by ratio between width (dx) and height (dy)
      i = 1
      while i < len(sizes) and worst_ratio(
          sizes[:i], x, y, dx, dy
      ) >= worst_ratio(sizes[: (i + 1)], x, y, dx, dy):
          i += 1
      current = sizes[:i]
  
      remaining = sizes[i:]
  
      (leftover_x, leftover_y, leftover_dx, leftover_dy) = leftover(
          current, x, y, dx, dy
      )
  
      return layout(current, x, y, dx, dy) + squarify(
          remaining, leftover_x, leftover_y, leftover_dx, leftover_dy
      )
  
file_path: aequitas/src/aequitas/squarify_flipped.py
imports: import matplotlib.pyplot
  import itertools
label_desc: Use image node_id 9 for calling a global function with example usage: squarify(sizes, x, y, dx, dy) and returns: unknown, list, layout