def generate_time_pairs(start_times, end_times):
    """Forms time pairs out of start times and end times
        Parameters
        ----------
        start_times : list
            contains all times where a condition applies
        end_times : list
            contains all times where the condition does not apply
        Return
        ------
        time_pair : list
            list of touples with start and end time
        """
    time_pair: float = []
    if not start_times:
        time_pair.append((0, 0))
    elif not end_times:
        time_pair.append((start_times[0], 0))
    else:
        time_hook = 0
        last_start_time = 0
        for start in list(sorted(set(start_times))):
            if start > time_hook:
                for end in list(sorted(set(end_times))):
                    if end > start:
                        time_pair.append((start, end))
                        time_hook = end
                        break
        if list(sorted(set(start_times)))[-1] > list(sorted(set(end_times)))[-1
            ]:
            time_pair.append((list(sorted(set(end_times)))[-1], 0))
    return time_pair
