def format(self, x, y, width):
        item = self.items[0]
        space = 0
        if (item.width < width):
            space = (width - item.width) / 2
            Path(x, y).h(space).addTo(self)
        item.format(x + space, y, item.width)
        item.addTo(self)
        prevItem = item
        for item in self.items[1:]:
            Path(x + space + prevItem.width, y + prevItem.yAdvance).arc('ne') \
                .v(prevItem.down - prevItem.yAdvance).arc('es') \
                .left((prevItem.width / 2) + (item.width / 2)).arc('nw').v(item.up).arc('ws').addTo(self)
            space = (width - item.width) / 2
            y += (ARC_RADIUS * 4) + prevItem.down + item.up
            item.format(x + space, y, item.width)
            item.addTo(self)
            prevItem = item
        if (0 < space):
            Path(x + prevItem.width + space, y + prevItem.yAdvance).h(space).addTo(self)
dataset/ETHPy150Open tabatkins/bikeshed/bikeshed/railroaddiagrams.py/Stack.format/original