<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _derive_distinct_intervals(self, rows):
 """ Returns the set of distinct intervals in a row set. :param list[dict[str,T]] rows: The rows set. :rtype: set[(int,int)] """

        ret = set()
        for row in rows:
            self._add_interval(ret, (row[self._key_start_date], row[self._key_end_date]))

        return ret