def merge(self, layers):
layers.sort()<EOL>if layers[<NUM_LIT:0>] == <NUM_LIT:0>: del layers[<NUM_LIT:0>]<EOL>self.flatten(layers)<EOL>
Flattens the given layers on the canvas.

        Merges the given layers with the indices in the list
        on the bottom layer in the list.
        The other layers are discarded.