<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove(self, first, count):
 """ Remove a range of count consecutive ids starting at id first from all the ranges in the set. """


        # Avoid trivialities
        if first < 0 or count < 1:
            return

        new_range = []
        last = first + count - 1
        for r in self.__range:
            if first <= r.last and r.first <= last:
                # There is an overlap
                if r.first < first:
                    new_range.append(IdRange(r.first, first-r.first))
                if last < r.last:
                    new_range.append(IdRange(last+1, r.last-last))
            else:
                # No overlap, range is kept
                new_range.append(r)

        self.__range = new_range