code: def is_perfect_rectangle(rectangles):
      areas_sum = 0
      all_points = set()
  
      for rect in rectangles:
          # sum the areas of all rectangles
          areas_sum += (rect[2] - rect[0]) * (rect[3] - rect[1])
  
          # find all points of the rectangle and check if they already exist
          rect_points = [
              (rect[0], rect[1]),  # left bottom
              (rect[0], rect[3]),  # left top
              (rect[2], rect[3]),  # right top
              (rect[2], rect[1]),  # right bottom
          ]
  
          for point in rect_points:
              if point in all_points:
                  all_points.remove(point)
              else:
                  all_points.add(point)
  
      # if we want a perfect rectangle then the rectangle must have 4 unique points
      if len(all_points) != 4:
          return False
  
      # find the bounding rectangle coordinates (minX, minY, maxX, maxY)
      bounding_rectangle = [math.inf, math.inf, -math.inf, -math.inf]
      for point in all_points:
          bounding_rectangle = [
              min(bounding_rectangle[0], point[0]),
              min(bounding_rectangle[1], point[1]),
              max(bounding_rectangle[2], point[0]),
              max(bounding_rectangle[3], point[1]),
          ]
  
      # calculate the area of bounding rectangle
      bounding_rectangle_area = (
          bounding_rectangle[2] - bounding_rectangle[0]
      ) * (bounding_rectangle[3] - bounding_rectangle[1])
  
      # to see if there are overlapping, compare the sum of areas with the final rectangle area
      return areas_sum == bounding_rectangle_area
  
label_desc: Use image node_id 1 for calling a global function with example usage: is_perfect_rectangle(rectangles) and returns: unknown, False