<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def pop_colorpoint(self, n=0):
 """ Removes and returns the specified colorpoint. Will always leave two behind. """


        # make sure we have more than 2; otherwise don't pop it, just return it
        if len(self._colorpoint_list) > 2:

            # do the popping
            x = self._colorpoint_list.pop(n)

            # make sure the endpoints are 0 and 1
            self._colorpoint_list[0][0]  = 0.0
            self._colorpoint_list[-1][0] = 1.0

            # update the image
            self.update_image()

            return x

        # otherwise just return the indexed item
        else: return self[n]