def ends(self, layer):
        """Retrieve end positions of elements if given layer."""
        ends = []
        for data in self[layer]:
            ends.append(data[END])
        return ends
def ends ( self , layer ) : ends = [ ] for data in self [ layer ] : ends . append ( data [ END ] ) return ends
Retrieve end positions of elements if given layer.