Add 'get_segments' method to the collections.LineCollection class