import re


def load_file(file) -> list:
    """
    Read a file containing a list of rectangle definitions, and return
        a list with the rectangle specs. The ID is the array location.
    :param file: Text file containing a rectangle definition on each
        line
    :return: List with parsed rectangle definition
    """
    rectangles = list()
    with open(file) as f:
        for line in f:
            rectangles.append(re.split('\D+', line)[1:-1])

    for i in range(len(rectangles)):
        for j in range(len(rectangles[i])):
            rectangles[i][j] = int(rectangles[i][j])
    return rectangles