<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def slice(self, start, end):
 """ Creates a copy of the current segment between indexes. If end > start, points are reverted Args: start (int):
 Start index end (int):
 End index Returns: :obj:`Segment` """


        reverse = False
        if start > end:
            temp = start
            start = end
            end = temp
            reverse = True

        seg = self.copy()
        seg.points = seg.points[start:end+1]
        if reverse:
            seg.points = list(reversed(seg.points))

        return seg